aknlayoutcompiler/src/MasterLayoutPack.cpp
changeset 1 b700e12870ca
parent 0 f58d6ec98e88
equal deleted inserted replaced
0:f58d6ec98e88 1:b700e12870ca
   123 	stream << "  all of the packages described in <packageListFile>." << endl;
   123 	stream << "  all of the packages described in <packageListFile>." << endl;
   124 	stream << "  The <packageListFile> should contain lines with the following contents:" << endl;
   124 	stream << "  The <packageListFile> should contain lines with the following contents:" << endl;
   125 	stream << "    <layout pack name> <width> <height> <layout variant> <content>*" << endl;
   125 	stream << "    <layout pack name> <width> <height> <layout variant> <content>*" << endl;
   126 	stream << "  If -z<zoomList> is specified, then instances for zoom factors" << endl;
   126 	stream << "  If -z<zoomList> is specified, then instances for zoom factors" << endl;
   127 	stream << "  (in the form \"n,string\") appearing in the file <zoomList> will be generated, " << endl;
   127 	stream << "  (in the form \"n,string\") appearing in the file <zoomList> will be generated, " << endl;
   128 	stream << "  by replacing the keyword $ZOOM in the package definitions." << endl;
   128 	stream << "  by replacing the keyword ZOOM in the package definitions." << endl;
   129 	}
   129 	}
   130 
   130 
   131 void MasterLayoutPackage_Process(
   131 void MasterLayoutPackage_Process(
   132 	const string& aName, 
   132 	const string& aName, 
   133 	const string& aWidth, 
   133 	const string& aWidth, 
   135 	const string& aId, 
   135 	const string& aId, 
   136 	vector<string>::const_iterator aBegin, 
   136 	vector<string>::const_iterator aBegin, 
   137 	vector<string>::const_iterator aEnd, 
   137 	vector<string>::const_iterator aEnd, 
   138 	const string& aZoomName)
   138 	const string& aZoomName)
   139 	{
   139 	{
   140 	CCdlTkCdlFileParser parser(KDirDomainSysHeader+KMasterLayoutPackCdlFile);
   140 	CCdlTkCdlFileParser parser(CdlTkUtil::CurrentDrive()+KDirDomainSysHeader+KMasterLayoutPackCdlFile);
   141 	auto_ptr<CCdlTkInterface> iface(parser.LoadAndParse(true));
   141 	auto_ptr<CCdlTkInterface> iface(parser.LoadAndParse(true));
   142 	CCdlTkInstance pkg(*iface);
   142 	CCdlTkInstance pkg(*iface);
   143 	pkg.TemplateAllImplementations();
   143 	pkg.TemplateAllImplementations();
   144 
   144 
   145 	string zoomName = CdlTkUtil::Replace("$ZOOM", aZoomName, aName);
   145 	string zoomName = CdlTkUtil::Replace("ZOOM", aZoomName, aName);
   146 	string zoomIdName = "EAknUiZoom" + aZoomName;
   146 	string zoomIdName = "EAknUiZoom" + aZoomName;
   147 
   147 
   148 	pkg.SetName(zoomName);
   148 	pkg.SetName(zoomName);
   149 
   149 
   150 /*	Implement(pkg, "name", "\"\"", string("\"")+zoomName+"\"");
   150 /*	Implement(pkg, "name", "\"\"", string("\"")+zoomName+"\"");
   155 */
   155 */
   156 	cout << zoomName << endl;
   156 	cout << zoomName << endl;
   157 
   157 
   158 	for (; aBegin != aEnd; ++aBegin)
   158 	for (; aBegin != aEnd; ++aBegin)
   159 		{
   159 		{
   160 		string zoomContent = CdlTkUtil::Replace("$ZOOM", aZoomName, *aBegin);
   160 		string zoomContent = CdlTkUtil::Replace("ZOOM", aZoomName, *aBegin);
   161 //		pkg.AddLocalContent(zoomContent);
   161 //		pkg.AddLocalContent(zoomContent);
   162 		cout << zoomContent << endl;
   162 		cout << zoomContent << endl;
   163 		}
   163 		}
   164 
   164 
   165 	CCdlTkWriteInstance writer(pkg);
   165 	CCdlTkWriteInstance writer(pkg);
   202 		}
   202 		}
   203 	}
   203 	}
   204 
   204 
   205 void MasterLayoutIndex::CreateTemplateInstance()
   205 void MasterLayoutIndex::CreateTemplateInstance()
   206 	{
   206 	{
   207 	CCdlTkCdlFileParser parser(KDirDomainSysHeader+KMasterLayoutPackCdlFile);
   207 	CCdlTkCdlFileParser parser(CdlTkUtil::CurrentDrive()+KDirDomainSysHeader+KMasterLayoutPackCdlFile);
   208 	iIface = parser.LoadAndParse(true);
   208 	iIface = parser.LoadAndParse(true);
   209 	iInst = auto_ptr<CCdlTkInstance>(new CCdlTkInstance(*iIface));
   209 	iInst = auto_ptr<CCdlTkInstance>(new CCdlTkInstance(*iIface));
   210 	iInst->TemplateAllImplementations();
   210 	iInst->TemplateAllImplementations();
   211 	iInst->SetName(iInstName);
   211 	iInst->SetName(iInstName);
   212 	// This master index should be the first in the DLL, so write it first.
   212 	// This master index should be the first in the DLL, so write it first.
   293 void MasterLayoutIndex::AddPkg(PackageInfoLine& aLine, const string& aZoom, string& aExtra, string& aImpl)
   293 void MasterLayoutIndex::AddPkg(PackageInfoLine& aLine, const string& aZoom, string& aExtra, string& aImpl)
   294 	{
   294 	{
   295 	string impl = "&";
   295 	string impl = "&";
   296 	string extra;
   296 	string extra;
   297 
   297 
   298 	string pkgName = CdlTkUtil::Replace("$ZOOM", aZoom, aLine[EPackNameArg]);
   298 	string pkgName = CdlTkUtil::Replace("ZOOM", aZoom, aLine[EPackNameArg]);
   299 	impl+=pkgName;
   299 	impl+=pkgName;
   300 
   300 
   301 	string refs;
   301 	string refs;
   302 	for (int refPos = EFirstContentArg; refPos < aLine.size(); ++refPos)
   302 	for (unsigned int refPos = EFirstContentArg; refPos < aLine.size(); ++refPos)
   303 		{
   303 		{
   304 		string refName = CdlTkUtil::Replace("$ZOOM", aZoom, aLine[refPos]);
   304 		string refName = CdlTkUtil::Replace("ZOOM", aZoom, aLine[refPos]);
   305 		CdlTkUtil::AppendString(refs, CdlTkUtil::Replace("$NAME",refName,"\tLOCAL_CDL_REF($NAME),\n"));
   305 		CdlTkUtil::AppendString(refs, CdlTkUtil::Replace("$NAME",refName,"\tLOCAL_CDL_REF($NAME),\n"));
   306 		}
   306 		}
   307 
   307 
   308 	CCdlTkDataTypeTranslations& translations = iIface->DataTypeTranslations();
   308 	CCdlTkDataTypeTranslations& translations = iIface->DataTypeTranslations();
   309 	string temp;
   309 	string temp;