aknlayoutcompiler/src/LayCdl2Inst.cpp
changeset 1 b700e12870ca
parent 0 f58d6ec98e88
child 20 8b4f687b7a95
equal deleted inserted replaced
0:f58d6ec98e88 1:b700e12870ca
    90 	auto_ptr<CCdlTkInterface> iface(parser.LoadAndParse(true));
    90 	auto_ptr<CCdlTkInterface> iface(parser.LoadAndParse(true));
    91 
    91 
    92 	LayoutAndCdlToCdlInstance process(*iface);
    92 	LayoutAndCdlToCdlInstance process(*iface);
    93 
    93 
    94 	TLayout* base = NULL;
    94 	TLayout* base = NULL;
    95 	for (int arg = 3; arg < args.size(); arg += 2)
    95 	for (unsigned int arg = 3; arg < args.size(); arg += 2)
    96 		{
    96 		{
    97 		string layoutName = args[arg];
    97 		string layoutName = args[arg];
    98 		string instName = args[arg+1];
    98 		string instName = args[arg+1];
    99 		auto_ptr<TLayParseLayout> layoutParse = TLayParseLayout::Parse(layoutName);
    99 		auto_ptr<TLayParseLayout> layoutParse = TLayParseLayout::Parse(layoutName);
   100 		auto_ptr<TLayout> layout(layoutParse.get());
   100 		auto_ptr<TLayout> layout(layoutParse.get());
   367 	if (!HasApi(apiName))
   367 	if (!HasApi(apiName))
   368 		return;
   368 		return;
   369 
   369 
   370 	CCdlTkImplementation& imp = FindImp(apiName);
   370 	CCdlTkImplementation& imp = FindImp(apiName);
   371 	const CCdlTkFunctionApi& api = imp.Api().AsFunc();
   371 	const CCdlTkFunctionApi& api = imp.Api().AsFunc();
   372 	const CCdlTkApiParams& params = api.Params();
   372 	//const CCdlTkApiParams& params = api.Params();
   373 
   373 
   374 	TLayoutLine& line = *aTable[aSubTable[0]];
   374 	TLayoutLine& line = *aTable[aSubTable[0]];
   375 	CCdlTkImplementation& lineImp = FindImp(LayoutToCdl::LineApiName(line));
   375 	CCdlTkImplementation& lineImp = FindImp(LayoutToCdl::LineApiName(line));
   376 	const CCdlTkApi& lineApi = lineImp.Api();
   376 	const CCdlTkApi& lineApi = lineImp.Api();
   377 
   377 
   380 		ptrType = iInterface.NamespaceName() + "::" + lineApi.PointerType();
   380 		ptrType = iInterface.NamespaceName() + "::" + lineApi.PointerType();
   381 	else
   381 	else
   382 		ptrType = lineApi.PointerType();
   382 		ptrType = lineApi.PointerType();
   383 	
   383 	
   384 	int valid = 0;
   384 	int valid = 0;
   385 	for (int ii=0; ii<aTable.size(); ii++)
   385 	for (unsigned int ii=0; ii<aTable.size(); ii++)
   386 		{
   386 		{
   387 		if (find(aSubTable.begin(), aSubTable.end(), ii) != aSubTable.end())
   387 		if (find(aSubTable.begin(), aSubTable.end(), ii) != aSubTable.end())
   388 			{
   388 			{
   389 			valid |= 1<<ii;
   389 			valid |= 1<<ii;
   390 			}
   390 			}
   493 const string KFunctionRect = "\tline.SetAllParentOffsets(" + KParamParentRect + ");\n";
   493 const string KFunctionRect = "\tline.SetAllParentOffsets(" + KParamParentRect + ");\n";
   494 
   494 
   495 void CLayoutToInst::SetFuncLine(CCdlTkImplementation& aImp, TLayoutLine& aLine, const string& aType, const string aOutputOrder[], int aOutputOrderSize, const string& aPreExtra, const string& aPostExtra)
   495 void CLayoutToInst::SetFuncLine(CCdlTkImplementation& aImp, TLayoutLine& aLine, const string& aType, const string aOutputOrder[], int aOutputOrderSize, const string& aPreExtra, const string& aPostExtra)
   496 	{
   496 	{
   497 	const CCdlTkFunctionApi& api = aImp.Api().AsFunc();
   497 	const CCdlTkFunctionApi& api = aImp.Api().AsFunc();
   498 	const CCdlTkApiParams& params = api.Params();
   498 	//const CCdlTkApiParams& params = api.Params();
   499 
   499 
   500 	string asserts;
   500 	string asserts;
   501 	string tables;
   501 	string tables;
   502 	string init;
   502 	string init;
   503 	string lookups;
   503 	string lookups;