aknlayoutcompiler/src/LayoutPack.cpp
changeset 1 b700e12870ca
parent 0 f58d6ec98e88
equal deleted inserted replaced
0:f58d6ec98e88 1:b700e12870ca
    58 	string& w = args[3];
    58 	string& w = args[3];
    59 	string& h = args[4];
    59 	string& h = args[4];
    60 	string& id = args[5];
    60 	string& id = args[5];
    61 
    61 
    62 	for(CZoomLevelNames::iterator pZoomName = zoomLevelNames.begin(); pZoomName != zoomLevelNames.end(); ++pZoomName)
    62 	for(CZoomLevelNames::iterator pZoomName = zoomLevelNames.begin(); pZoomName != zoomLevelNames.end(); ++pZoomName)
       
    63 		{
       
    64 		//string zoomName = CdlTkUtil::Replace("\r", "", pZoomName->second);
       
    65 		//zoomName = CdlTkUtil::Replace("\n", "", zoomName);
    63 		Process(name, w, h, id, styleName, deliveryTypeName, priority, appUid, args.begin() + 6, args.end(), pZoomName->second);
    66 		Process(name, w, h, id, styleName, deliveryTypeName, priority, appUid, args.begin() + 6, args.end(), pZoomName->second);
    64 
    67 		}
    65 	return 0;
    68 	return 0;
    66 	}
    69 	}
    67 
    70 
    68 void LayoutPackage::ShowHelp(ostream& stream)
    71 void LayoutPackage::ShowHelp(ostream& stream)
    69 	{
    72 	{
    73 	stream << "    The size of screen that it applies to." << endl;
    76 	stream << "    The size of screen that it applies to." << endl;
    74 	stream << "    The layout variant it is used for." << endl;
    77 	stream << "    The layout variant it is used for." << endl;
    75 	stream << "    The contents of the package." << endl;
    78 	stream << "    The contents of the package." << endl;
    76 	stream << "  If -z<zoomList> is specified, then instances for zoom factors" << endl;
    79 	stream << "  If -z<zoomList> is specified, then instances for zoom factors" << endl;
    77 	stream << "    (in the form \"n,string\") appearing in the file <zoomList> will be generated, " << endl;
    80 	stream << "    (in the form \"n,string\") appearing in the file <zoomList> will be generated, " << endl;
    78 	stream << "    by replacing the keyword $ZOOM in the package definitions." << endl;
    81 	stream << "    by replacing the keyword ZOOM in the package definitions." << endl;
    79 	stream << "  If -s<screenStyleName> is specified, then instances for the appropriate" << endl;
    82 	stream << "  If -s<screenStyleName> is specified, then instances for the appropriate" << endl;
    80 	stream << "    screen style as found in WSINI.INI will be generated." << endl;
    83 	stream << "    screen style as found in WSINI.INI will be generated." << endl;
    81 	stream << "  If -d<deliveryType> is specified then the delivery type will be appended to" << endl;
    84 	stream << "  If -d<deliveryType> is specified then the delivery type will be appended to" << endl;
    82 	stream << "    the layout XML directory name." << endl;
    85 	stream << "    the layout XML directory name." << endl;
    83 	stream << "  If -p<priority> is specified then the pack will be loaded in priority order compared to " << endl;
    86 	stream << "  If -p<priority> is specified then the pack will be loaded in priority order compared to " << endl;
    98     const string& aAppUid,
   101     const string& aAppUid,
    99 	vector<string>::const_iterator aBegin, 
   102 	vector<string>::const_iterator aBegin, 
   100 	vector<string>::const_iterator aEnd, 
   103 	vector<string>::const_iterator aEnd, 
   101 	const string& aZoomName)
   104 	const string& aZoomName)
   102 	{
   105 	{
   103 	CCdlTkCdlFileParser parser(KDirDomainSysHeader+KLayoutPackCdlFile);
   106 	CCdlTkCdlFileParser parser(CdlTkUtil::CurrentDrive()+KDirDomainSysHeader+KLayoutPackCdlFile);
   104 	auto_ptr<CCdlTkInterface> iface(parser.LoadAndParse(true));
   107 	auto_ptr<CCdlTkInterface> iface(parser.LoadAndParse(true));
   105 	CCdlTkPackage pkg(*iface);
   108 	CCdlTkPackage pkg(*iface);
   106 	pkg.TemplateAllImplementations();
   109 	pkg.TemplateAllImplementations();
   107 
   110 
   108 	string zoomName = CdlTkUtil::Replace("$ZOOM", aZoomName, aName);
   111 	string zoomName = CdlTkUtil::Replace("ZOOM", aZoomName, aName);
   109 	string zoomIdName = "EAknUiZoom" + aZoomName;
   112 	string zoomIdName = "EAknUiZoom" + aZoomName;
   110 	string styleHash = Hash(aStyleName);
   113 	string styleHash = Hash(aStyleName);
   111     string priority = CdlTkUtil::IntToString(CdlTkUtil::ParseInt(aPriority));
   114     string priority = CdlTkUtil::IntToString(CdlTkUtil::ParseInt(aPriority));
   112     string appUid = CdlTkUtil::IntToHexString(CdlTkUtil::ParseInt(aAppUid));
   115     string appUid = CdlTkUtil::IntToHexString(CdlTkUtil::ParseInt(aAppUid));
   113 
   116 
   143 
   146 
   144 			if (++aBegin == aEnd)
   147 			if (++aBegin == aEnd)
   145 				throw LayoutPackageArgsErr();
   148 				throw LayoutPackageArgsErr();
   146 			const string& inst = *aBegin;
   149 			const string& inst = *aBegin;
   147 
   150 
   148 			string zoomContent = CdlTkUtil::Replace("$ZOOM", aZoomName, inst);
   151 			string zoomContent = CdlTkUtil::Replace("ZOOM", aZoomName, inst);
   149 			pkg.AddExternalContent(zoomContent, dir, dll);
   152 			pkg.AddExternalContent(zoomContent, dir, dll);
   150 			}
   153 			}
   151 		else
   154 		else
   152 			{
   155 			{
   153 			string zoomContent = CdlTkUtil::Replace("$ZOOM", aZoomName, arg);
   156 			string zoomContent = CdlTkUtil::Replace("ZOOM", aZoomName, arg);
   154 			pkg.AddLocalContent(zoomContent);
   157 			pkg.AddLocalContent(zoomContent);
   155 			cout << zoomContent << endl;
   158 			cout << zoomContent << endl;
   156 			}
   159 			}
   157 		}
   160 		}
   158 
   161