1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/graphics/graphicstest/uibench/s60/src/tests_zorder/glplanetsapp.cpp Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,123 @@
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 "glplanetsapp.h"
1.21 +
1.22 +#include <e32debug.h>
1.23 +#include <eikenv.h>
1.24 +#include <eikstart.h>
1.25 +
1.26 +
1.27 +_LIT( KParentQueueName, "zorder");
1.28 +
1.29 +
1.30 +void CGLPlanetsAppUi::ConstructL()
1.31 + {
1.32 + // Create app framework
1.33 + CEikAppUi::BaseConstructL(ENoAppResourceFile);
1.34 + iAppView = new(ELeave) CGLPlanetsAppView(*this);
1.35 + iAppView->ConstructL(ClientRect());
1.36 + AddToStackL(iAppView);
1.37 + iAppView->ActivateL();
1.38 + }
1.39 +
1.40 +CGLPlanetsAppUi::~CGLPlanetsAppUi()
1.41 + {
1.42 + delete iGLPlanets;
1.43 + if (iAppView)
1.44 + {
1.45 + RemoveFromStack(iAppView);
1.46 + delete iAppView;
1.47 + }
1.48 + }
1.49 +
1.50 +/** Process command parameters */
1.51 +TBool CGLPlanetsAppUi::ProcessCommandParametersL(CApaCommandLine &aCommandLine)
1.52 + {
1.53 + TPtrC backgroundColor = aCommandLine.ExecutableName();
1.54 + iGLPlanets = CGLPlanets::NewL(iAppView->Window(), backgroundColor, this, KParentQueueName());
1.55 + iGLPlanets->Start();
1.56 + return CEikAppUi::ProcessCommandParametersL(aCommandLine);
1.57 + }
1.58 +
1.59 +void CGLPlanetsAppUi::Terminate()
1.60 + {
1.61 + PrepareToExit();
1.62 + CActiveScheduler::Stop();
1.63 + }
1.64 +
1.65 +void CGLPlanetsAppUi::BringToFront()
1.66 + {
1.67 + RWindow window = iAppView->Window();
1.68 + RWsSession wsSession = iAppView->ControlEnv()->WsSession();
1.69 + wsSession.SetWindowGroupOrdinalPosition(window.WindowGroupId(), 0);
1.70 + wsSession.Flush();
1.71 + wsSession.Finish();
1.72 + }
1.73 +
1.74 +
1.75 +CGLPlanetsAppView::CGLPlanetsAppView(CGLPlanetsAppUi& aAppUi): iAppUi(aAppUi)
1.76 + {
1.77 + // empty
1.78 + }
1.79 +
1.80 +void CGLPlanetsAppView::ConstructL(const TRect& aRect)
1.81 + {
1.82 + CreateWindowL();
1.83 + SetRect(aRect);
1.84 + }
1.85 +
1.86 +CGLPlanetsAppView::~CGLPlanetsAppView()
1.87 + {
1.88 + // empty
1.89 + }
1.90 +
1.91 +
1.92 +CGLPlanetsAppDocument::CGLPlanetsAppDocument(CEikApplication& aApp) : CEikDocument(aApp)
1.93 + {
1.94 + // empty
1.95 + }
1.96 +
1.97 +CEikAppUi* CGLPlanetsAppDocument::CreateAppUiL()
1.98 + {
1.99 + return new(ELeave) CGLPlanetsAppUi;
1.100 + }
1.101 +
1.102 +
1.103 +TUid CGLPlanetsApp::AppDllUid() const
1.104 + {
1.105 + return TUid::Uid(0x101FCABE);
1.106 + }
1.107 +
1.108 +CApaDocument* CGLPlanetsApp::CreateDocumentL()
1.109 + {
1.110 + return new(ELeave) CGLPlanetsAppDocument(*this);
1.111 + }
1.112 +
1.113 +//
1.114 +// Exported function
1.115 +//
1.116 +
1.117 +/** Application factory function */
1.118 +LOCAL_C CApaApplication* NewApplication()
1.119 + {
1.120 + return new CGLPlanetsApp;
1.121 + }
1.122 +
1.123 +GLDEF_C TInt E32Main()
1.124 + {
1.125 + return EikStart::RunApplication(NewApplication);
1.126 + }