os/graphics/graphicstest/uibench/s60/src/tests_zorder/multiplesurfacesapp.cpp
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
     1  // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
     2  // All rights reserved.
     3  // This component and the accompanying materials are made available
     4  // under the terms of "Eclipse Public License v1.0"
     5  // which accompanies this distribution, and is available
     6  // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7  //
     8  // Initial Contributors:
     9  // Nokia Corporation - initial contribution.
    10  //
    11  // Contributors:
    12  //
    13  // Description:
    14  //
    15 
    16 
    17 #include "multiplesurfacesapp.h"
    18 #include "cmultiplesurfaces.h"
    19 
    20 #include <e32debug.h>
    21 #include <eikenv.h>
    22 #include <eikstart.h>
    23 
    24 
    25 void CMultipleSurfacesAppUi::ConstructL()
    26     {
    27 	// Create app framework
    28 	CEikAppUi::BaseConstructL(ENoAppResourceFile);
    29 	iAppView = new(ELeave) CMultipleSurfacesAppView(*this);
    30 	iAppView->ConstructL(ClientRect());
    31 	AddToStackL(iAppView);
    32 	iAppView->ActivateL();
    33     }
    34 
    35 CMultipleSurfacesAppUi::~CMultipleSurfacesAppUi()
    36 	{
    37 	delete iMultipleSurfaces;
    38 	if (iAppView)
    39 		{	
    40 		RemoveFromStack(iAppView);
    41 		delete iAppView;		
    42 		}
    43 	}
    44 
    45 /** Process command parameters */
    46 TBool CMultipleSurfacesAppUi::ProcessCommandParametersL(CApaCommandLine &aCommandLine)
    47 	{
    48 	TPtrC childQueueName = aCommandLine.ExecutableName();	
    49 	iMultipleSurfaces = CMultipleSurfaces::NewL(CCoeEnv::Static()->WsSession(),
    50 	        CCoeEnv::Static()->RootWin(), childQueueName, this, KParentQueueName());
    51 	iMultipleSurfaces->Start();
    52 	return CEikAppUi::ProcessCommandParametersL(aCommandLine);
    53 	}
    54 
    55 void CMultipleSurfacesAppUi::Terminate()
    56 	{
    57 	PrepareToExit();
    58 	CActiveScheduler::Stop();
    59 	}
    60 
    61 void CMultipleSurfacesAppUi::BringToFront()
    62 	{
    63 	RWindow window = iAppView->Window();
    64 	RWsSession wsSession = iAppView->ControlEnv()->WsSession();
    65 	wsSession.SetWindowGroupOrdinalPosition(window.WindowGroupId(), 0);
    66 	wsSession.Flush();
    67 	wsSession.Finish();		
    68 	}
    69 
    70 
    71 CMultipleSurfacesAppView::CMultipleSurfacesAppView(CMultipleSurfacesAppUi& aAppUi) :
    72         CCoeControl(), iAppUi(aAppUi)
    73 	{
    74 	// empty
    75 	}
    76 
    77 void CMultipleSurfacesAppView::ConstructL(const TRect& aRect)
    78     {
    79     CreateWindowL();
    80     SetRect(aRect);    
    81 	}
    82 
    83 CMultipleSurfacesAppView::~CMultipleSurfacesAppView()
    84 	{
    85 	// empty
    86 	}
    87 
    88 
    89 CMultipleSurfacesAppDocument::CMultipleSurfacesAppDocument(CEikApplication& aApp) : CEikDocument(aApp)
    90 	{
    91 	// empty
    92 	}
    93 
    94 CEikAppUi* CMultipleSurfacesAppDocument::CreateAppUiL()
    95 	{
    96     return new(ELeave) CMultipleSurfacesAppUi;
    97 	}
    98 
    99 
   100 TUid CMultipleSurfacesApp::AppDllUid() const
   101 	{
   102 	return TUid::Uid(0x101FCABE);
   103 	}
   104 
   105 CApaDocument* CMultipleSurfacesApp::CreateDocumentL()
   106 	{
   107 	return new(ELeave) CMultipleSurfacesAppDocument(*this);
   108 	}
   109 
   110 LOCAL_C CApaApplication* NewApplication()
   111 	{
   112 	return new CMultipleSurfacesApp;
   113 	}
   114 
   115 GLDEF_C TInt E32Main()
   116 	{	
   117 	return EikStart::RunApplication(NewApplication);
   118 	}