sl@0: // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // sl@0: sl@0: sl@0: #include "glplanetsapp.h" sl@0: sl@0: #include sl@0: #include sl@0: #include sl@0: sl@0: sl@0: _LIT( KParentQueueName, "zorder"); sl@0: sl@0: sl@0: void CGLPlanetsAppUi::ConstructL() sl@0: { sl@0: // Create app framework sl@0: CEikAppUi::BaseConstructL(ENoAppResourceFile); sl@0: iAppView = new(ELeave) CGLPlanetsAppView(*this); sl@0: iAppView->ConstructL(ClientRect()); sl@0: AddToStackL(iAppView); sl@0: iAppView->ActivateL(); sl@0: } sl@0: sl@0: CGLPlanetsAppUi::~CGLPlanetsAppUi() sl@0: { sl@0: delete iGLPlanets; sl@0: if (iAppView) sl@0: { sl@0: RemoveFromStack(iAppView); sl@0: delete iAppView; sl@0: } sl@0: } sl@0: sl@0: /** Process command parameters */ sl@0: TBool CGLPlanetsAppUi::ProcessCommandParametersL(CApaCommandLine &aCommandLine) sl@0: { sl@0: TPtrC backgroundColor = aCommandLine.ExecutableName(); sl@0: iGLPlanets = CGLPlanets::NewL(iAppView->Window(), backgroundColor, this, KParentQueueName()); sl@0: iGLPlanets->Start(); sl@0: return CEikAppUi::ProcessCommandParametersL(aCommandLine); sl@0: } sl@0: sl@0: void CGLPlanetsAppUi::Terminate() sl@0: { sl@0: PrepareToExit(); sl@0: CActiveScheduler::Stop(); sl@0: } sl@0: sl@0: void CGLPlanetsAppUi::BringToFront() sl@0: { sl@0: RWindow window = iAppView->Window(); sl@0: RWsSession wsSession = iAppView->ControlEnv()->WsSession(); sl@0: wsSession.SetWindowGroupOrdinalPosition(window.WindowGroupId(), 0); sl@0: wsSession.Flush(); sl@0: wsSession.Finish(); sl@0: } sl@0: sl@0: sl@0: CGLPlanetsAppView::CGLPlanetsAppView(CGLPlanetsAppUi& aAppUi): iAppUi(aAppUi) sl@0: { sl@0: // empty sl@0: } sl@0: sl@0: void CGLPlanetsAppView::ConstructL(const TRect& aRect) sl@0: { sl@0: CreateWindowL(); sl@0: SetRect(aRect); sl@0: } sl@0: sl@0: CGLPlanetsAppView::~CGLPlanetsAppView() sl@0: { sl@0: // empty sl@0: } sl@0: sl@0: sl@0: CGLPlanetsAppDocument::CGLPlanetsAppDocument(CEikApplication& aApp) : CEikDocument(aApp) sl@0: { sl@0: // empty sl@0: } sl@0: sl@0: CEikAppUi* CGLPlanetsAppDocument::CreateAppUiL() sl@0: { sl@0: return new(ELeave) CGLPlanetsAppUi; sl@0: } sl@0: sl@0: sl@0: TUid CGLPlanetsApp::AppDllUid() const sl@0: { sl@0: return TUid::Uid(0x101FCABE); sl@0: } sl@0: sl@0: CApaDocument* CGLPlanetsApp::CreateDocumentL() sl@0: { sl@0: return new(ELeave) CGLPlanetsAppDocument(*this); sl@0: } sl@0: sl@0: // sl@0: // Exported function sl@0: // sl@0: sl@0: /** Application factory function */ sl@0: LOCAL_C CApaApplication* NewApplication() sl@0: { sl@0: return new CGLPlanetsApp; sl@0: } sl@0: sl@0: GLDEF_C TInt E32Main() sl@0: { sl@0: return EikStart::RunApplication(NewApplication); sl@0: }