Symbian之源码分析之EikEnv.cpp
2010-07-04 15:42:00 来源:WEB开发网iEikEnvExtra->iDefaultScreenNumber = aCommandLine.DefaultScreen();
else
{ //否则用apparc保存的默认screen
if (!err)
err = apparcServer.GetDefaultScreenNumber(iEikEnvExtra->iDefaultScreenNumber, RProcess().Type()[2]);
if (err)
iEikEnvExtra->iDefaultScreenNumber = 0;
}
//关闭AppArc server session
CleanupStack::PopAndDestroy(&apparcServer);
//创建应用程序环境,调用CEikonEnv::ConstructL()
const TBool startAppInForeground = (command!=EApaCommandBackground && command!=EApaCommandBackgroundAndWithoutViews);
ConstructL(startAppInForeground, aCommandLine.ParentWindowGroupID());
……
}
CEikEnv::ConstructL()
{
//调用基类ConstructL()
CCoeEnv::ConstructL()
//一系列初始化
……
//似乎加载dll库的地方在这里
LoadLibrariesL();
}
CCoeEnv::ConstructL()
{
//创建iExtra
iExtra=new(ELeave) CCoeEnvExtra;
iExtra->ConstructL();
//创建ActiveScheduler
CreateActiveSchedulerL();
CActiveScheduler::Add(this);
//一系列初始化sessions、screen、gc、font等等
ConnectToFileServerL();
ConnectToWindowServerL();
InitScreenL( aDefaultScreenNumber); // Modified May 04 support for Multiple Screens.
InitRootWindowL(aInitialFocusState, aWindowGroupID);
InitSystemFontsL();
InitSystemGcL();
……
//等待WSERV的事件
iWsSession.EventReady(&iStatus);
SetActive();
//当RunL被调用时,会先调用iAppUi->MonitorWsEvent(event)
//在AppUi中设置过Moniotr的可以在MonitorWsEvent中处理所有的event
//再调用iAppUi->HandleWsEventL(event,window)
//CCoeAppUi::HandleWsEventL会根据TWsEvent分发事件给CCoeControl
更多精彩
赞助商链接