diff options
| author | louis <louis.braun@gmx.de> | 2015-05-30 16:43:59 +0200 |
|---|---|---|
| committer | louis <louis.braun@gmx.de> | 2015-05-30 16:43:59 +0200 |
| commit | 17871b8811baa9478b2b3247e340aa21bb64e06e (patch) | |
| tree | c3c2139244bbb11d4f0cf3d32e02c1137e29a1c2 /libtemplate/templateloopfunction.c | |
| parent | 0936766c7be02661f1cd678fdd1b6fb22b5d122c (diff) | |
| download | vdr-plugin-skindesigner-17871b8811baa9478b2b3247e340aa21bb64e06e.tar.gz vdr-plugin-skindesigner-17871b8811baa9478b2b3247e340aa21bb64e06e.tar.bz2 | |
implemented Skin Repositories
Diffstat (limited to 'libtemplate/templateloopfunction.c')
| -rw-r--r-- | libtemplate/templateloopfunction.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/libtemplate/templateloopfunction.c b/libtemplate/templateloopfunction.c index 4de9ec4..07219ac 100644 --- a/libtemplate/templateloopfunction.c +++ b/libtemplate/templateloopfunction.c @@ -21,8 +21,8 @@ void cTemplateLoopFunction::AddFunction(string name, vector<pair<string, string> if (!name.compare("drawtext")) { type = ftDrawText; } else if (!name.compare("drawtextbox")) { - type = ftDrawTextBox; - } else if (!name.compare("drawimage")) { + type = ftDrawTextBox; + } else if (!name.compare("drawimage")) { type = ftDrawImage; } else if (!name.compare("drawrectangle")) { type = ftDrawRectangle; @@ -149,6 +149,21 @@ int cTemplateLoopFunction::GetLoopElementsHeight(void) { return maxHeight; } +int cTemplateLoopFunction::CalculateHeight(map < string, vector< map< string, string > > > *loopTokens) { + if (!loopTokens) { + return 0; + } + int rowHeight = GetLoopElementsHeight(); + string loopName = GetParameter(ptName); + map < string, vector< map< string, string > > >::iterator hit = loopTokens->find(loopName); + if (hit == loopTokens->end()) + return 0; + vector< map< string, string > > toks = hit->second; + int numElements = toks.size(); + + return numElements * rowHeight; +} + bool cTemplateLoopFunction::ReplaceWidthFunctions(void) { bool replaced = false; InitIterator(); |
