os/graphics/graphicstest/uibench/s60/src/tests_zorder/multiplesurfacesapp.cpp
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/graphics/graphicstest/uibench/s60/src/tests_zorder/multiplesurfacesapp.cpp	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,118 @@
     1.4 + // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 + // All rights reserved.
     1.6 + // This component and the accompanying materials are made available
     1.7 + // under the terms of "Eclipse Public License v1.0"
     1.8 + // which accompanies this distribution, and is available
     1.9 + // at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 + //
    1.11 + // Initial Contributors:
    1.12 + // Nokia Corporation - initial contribution.
    1.13 + //
    1.14 + // Contributors:
    1.15 + //
    1.16 + // Description:
    1.17 + //
    1.18 +
    1.19 +
    1.20 +#include "multiplesurfacesapp.h"
    1.21 +#include "cmultiplesurfaces.h"
    1.22 +
    1.23 +#include <e32debug.h>
    1.24 +#include <eikenv.h>
    1.25 +#include <eikstart.h>
    1.26 +
    1.27 +
    1.28 +void CMultipleSurfacesAppUi::ConstructL()
    1.29 +    {
    1.30 +	// Create app framework
    1.31 +	CEikAppUi::BaseConstructL(ENoAppResourceFile);
    1.32 +	iAppView = new(ELeave) CMultipleSurfacesAppView(*this);
    1.33 +	iAppView->ConstructL(ClientRect());
    1.34 +	AddToStackL(iAppView);
    1.35 +	iAppView->ActivateL();
    1.36 +    }
    1.37 +
    1.38 +CMultipleSurfacesAppUi::~CMultipleSurfacesAppUi()
    1.39 +	{
    1.40 +	delete iMultipleSurfaces;
    1.41 +	if (iAppView)
    1.42 +		{	
    1.43 +		RemoveFromStack(iAppView);
    1.44 +		delete iAppView;		
    1.45 +		}
    1.46 +	}
    1.47 +
    1.48 +/** Process command parameters */
    1.49 +TBool CMultipleSurfacesAppUi::ProcessCommandParametersL(CApaCommandLine &aCommandLine)
    1.50 +	{
    1.51 +	TPtrC childQueueName = aCommandLine.ExecutableName();	
    1.52 +	iMultipleSurfaces = CMultipleSurfaces::NewL(CCoeEnv::Static()->WsSession(),
    1.53 +	        CCoeEnv::Static()->RootWin(), childQueueName, this, KParentQueueName());
    1.54 +	iMultipleSurfaces->Start();
    1.55 +	return CEikAppUi::ProcessCommandParametersL(aCommandLine);
    1.56 +	}
    1.57 +
    1.58 +void CMultipleSurfacesAppUi::Terminate()
    1.59 +	{
    1.60 +	PrepareToExit();
    1.61 +	CActiveScheduler::Stop();
    1.62 +	}
    1.63 +
    1.64 +void CMultipleSurfacesAppUi::BringToFront()
    1.65 +	{
    1.66 +	RWindow window = iAppView->Window();
    1.67 +	RWsSession wsSession = iAppView->ControlEnv()->WsSession();
    1.68 +	wsSession.SetWindowGroupOrdinalPosition(window.WindowGroupId(), 0);
    1.69 +	wsSession.Flush();
    1.70 +	wsSession.Finish();		
    1.71 +	}
    1.72 +
    1.73 +
    1.74 +CMultipleSurfacesAppView::CMultipleSurfacesAppView(CMultipleSurfacesAppUi& aAppUi) :
    1.75 +        CCoeControl(), iAppUi(aAppUi)
    1.76 +	{
    1.77 +	// empty
    1.78 +	}
    1.79 +
    1.80 +void CMultipleSurfacesAppView::ConstructL(const TRect& aRect)
    1.81 +    {
    1.82 +    CreateWindowL();
    1.83 +    SetRect(aRect);    
    1.84 +	}
    1.85 +
    1.86 +CMultipleSurfacesAppView::~CMultipleSurfacesAppView()
    1.87 +	{
    1.88 +	// empty
    1.89 +	}
    1.90 +
    1.91 +
    1.92 +CMultipleSurfacesAppDocument::CMultipleSurfacesAppDocument(CEikApplication& aApp) : CEikDocument(aApp)
    1.93 +	{
    1.94 +	// empty
    1.95 +	}
    1.96 +
    1.97 +CEikAppUi* CMultipleSurfacesAppDocument::CreateAppUiL()
    1.98 +	{
    1.99 +    return new(ELeave) CMultipleSurfacesAppUi;
   1.100 +	}
   1.101 +
   1.102 +
   1.103 +TUid CMultipleSurfacesApp::AppDllUid() const
   1.104 +	{
   1.105 +	return TUid::Uid(0x101FCABE);
   1.106 +	}
   1.107 +
   1.108 +CApaDocument* CMultipleSurfacesApp::CreateDocumentL()
   1.109 +	{
   1.110 +	return new(ELeave) CMultipleSurfacesAppDocument(*this);
   1.111 +	}
   1.112 +
   1.113 +LOCAL_C CApaApplication* NewApplication()
   1.114 +	{
   1.115 +	return new CMultipleSurfacesApp;
   1.116 +	}
   1.117 +
   1.118 +GLDEF_C TInt E32Main()
   1.119 +	{	
   1.120 +	return EikStart::RunApplication(NewApplication);
   1.121 +	}