Symbian之源码分析之EikEnv.cpp
2010-07-04 15:42:00 来源:WEB开发网//同时等待下一个WSERV事件
}
网上关于symbian源码分析的文章非常少,而本人对于symbian的一些底层机制也不是非常的清晰,所以难免出错,欢迎大家在回复中指出。
继续跟踪CEikonEnv::ConstructAppFromCommandLineL的代码:
CEikonEnv::ConstructAppFromCommandLineL()
{
……
//创建程序进程
iProcess = CEikProcess::NewL(iFsSession, aCommandLine.ParentProcessId());
//是否作为一个服务器启动程序?
const TUint serverDifferentiator = aCommandLine.ServerRequired();
if (serverDifferentiator)
iEikonEnvFlags.Set(EStartedAsServerApp);
//是否将程序放到后台运行
if (!startAppInForeground)
{
iRootWin.SetOrdinalPosition(-1000);
iRootWin.EnableReceiptOfFocus(ETrue);
if (RProcess().Priority() <= EPriorityForeground)
RThread().SetProcessPriority(EPriorityBackground);
}
//在AddNewDocumentL里面会先创建Application,再创建Document
//http://developer.symbian.org/oss/FCL/interim/sf-test/platform/smoketest/file/c108117318cb/localisation/apparchitecture/apparc/APPARC.CPP
CEikDocument& doc = *static_cast(iProcess->AddNewDocumentL(aApplicationFactory));
iProcess->SetMainDocument(&doc);
//在这里创建AppUi
doc.PrepareToEditL(); // creates AppUi
CEikAppUi& appUi = *EikAppUi();
//初始化ViewManager
const TBool runAppWithoutViews = (command==EApaCommandRunWithoutViews || command==EApaCommandBackgroundAndWithoutViews);
if (!runAppWithoutViews)
appUi.CheckInitializeViewsL(appUi.Application()->AppDllUid());
//创建CEikStartUpViewActivator
if (startAppInForeground && command!=EApaCommandViewActivate )
iEikEnvExtra->iViewActivator = CEikStartUpViewActivator::NewL(appUi, *this, iEikEnvExtra->iViewActivator);
更多精彩
赞助商链接