void CWsTop::InitStaticsL() { iShuttingDown=EFalse; // By default shell should be started. TBool startShell = ETrue; iCurrentFocusScreen = 0; // The windows server has been invoked. // This may have been from the system starter (via a // start up rss file) // This block looks for a "-NoShell" argument in the invocation. // The existence of the argument means that shell does not need to be // invoked from here because the new system starter // is in charge, and it will do it if required. _LIT(KNoShell,"-NOSHELL"); TInt argLen = User::CommandLineLength(); if(argLen) { HBufC* arg = HBufC::NewLC(argLen); TPtr argPtr = arg->Des(); User::CommandLine(argPtr); argPtr.UpperCase(); if(KErrNotFound != argPtr.Find(KNoShell)) { // Don't start the shell. It will be started if required by // the system starter. startShell = EFalse; } CleanupStack::PopAndDestroy(arg); } TheActiveScheduler=new(ELeave) CWsActiveScheduler; CActiveScheduler::Install(TheActiveScheduler); // WsIniFile is already created (before E32Main's Loop) _LIT(KWSERVIniFileVarLogEnable,"LOGENABLE"); TInt loggingLevel; if (WsIniFile->FindVar(KWSERVIniFileVarLogEnable,loggingLevel)) { EnableLogging(EDoNotReloadWsIni); if (wsDebugLog) { wsDebugLog->SetLoggingLevel(loggingLevel); } } _LIT(KWSERVIniFileVarFadeEnable,"FADEDISABLE"); iFadeEnabled = !WsIniFile->FindVar(KWSERVIniFileVarFadeEnable); _LIT(KWSERVIniFileVarFinishEveryFlush,"FINISHEVERYFLUSH"); iFinishEveryFlush = WsIniFile->FindVar(KWSERVIniFileVarFinishEveryFlush); _LIT(KWSERVIniFileVarSwitchOffEvent,"IGNORESWITCHOFFEVENT"); iIgnoreSwitchOffEvent = WsIniFile->FindVar(KWSERVIniFileVarSwitchOffEvent); iPluginManager = CWsPluginManager::NewL(); // need to be constructed before iServer! iServer=CWindowServer::NewL(); CClick::InitStaticsL(); RProcess wservProc; if (!wservProc.DefaultDataPaged()) { iServer->SetPinClientDescriptors(ETrue); } User::LeaveIfError(FbsStartup()); User::LeaveIfError(RFbsSession::Connect()); User::LeaveIfError(iTimer.CreateLocal()); TWindowServerEvent::InitStaticsL(); CWsClient::InitStaticsL(); //------------------------------------------- User::LeaveIfError( HAL::Get( HAL::EDisplayNumberOfScreens, iNumberOfScreens ) ) ; // Check that the INI file matches the HAL WS_ASSERT_ALWAYS(WsIniFile->NumberOfScreens()<=iNumberOfScreens, EWsPanicScreenInformationError); iScreens = new (ELeave) CArrayPtrFlat<CScreen>( iNumberOfScreens ) ; // // now construct screens for as long as there is information TInt ii ; for ( ii = 0 ; ii < iNumberOfScreens ; ++ii ) { InitScreenL( ii ) ; } //--------------------------------------------- iCurrentFocusScreen = (*iScreens)[0] ; iServer->StartL(); CWsFontCache::CreateInstanceL(); CWsGc::InitStaticsL(); CPlaybackGc::InitStaticsL(); CWsSpriteBase::InitStaticsL(); CEventQueue::InitStaticsL(); // CWsAnimDll::InitStaticsL(); // TInt bootMode=0; _LIT(KWSERVIniFileVarReboot,"REBOOT"); WsIniFile->FindVar(KWSERVIniFileVarReboot,bootMode); if (bootMode>=0 && bootMode<=2) iShellBootMode=bootMode; // CWsBackedUpWindow::StaticInitL(); CWsRedrawMsgWindow::StaticInitL(); // TWsPointer::InitStaticsL(); iShellStarter=new (ELeave) CShellStarter; iShellStarter->ConstructL(); _LIT(KPreProcess,"REMOVEFADINGONFOCUSGAIN"); CWsWindowGroup::SetFocusGainPreprocessing(WsIniFile->FindVar(KPreProcess)); _LIT(KAbsFade,"ABSOLUTEFADING"); CWsClientWindow::SetAbsoluteFading(WsIniFile->FindVar(KAbsFade)); //Set the focus policy _LIT(KFocusPolicy,"MULTIFOCUSPOLICY"); if(WsIniFile->FindVar(KFocusPolicy)) { iMultiFocusPolicy = ETrue; } RProcess::Rendezvous(KErrNone); // Start the shell from here unless the 'NoShell' option has been // received indicating that the system starter will start the shell directly. if(startShell) { StartShell(); } UserSvr::WsRegisterSwitchOnScreenHandling(ETrue); iRenderOrientationTracker = CWsRenderOrienationTracker::NewL(); }
void CWsRootWindow::ClearDisplay() { MWsScreenDevice *sd=static_cast<MWsScreenDevice*>(iScreen->ResolveObjectInterface(KMWsScreenDevice)); WS_ASSERT_ALWAYS(sd, EWsPanicScreenDeviceMissing); sd->ClearDisplay(BackColor()); }