summaryrefslogtreecommitdiff
path: root/xml/skin.c
diff options
context:
space:
mode:
authorChristian Tusche <chr13@gmx.net>2009-06-06 23:17:58 +0200
committerThomas Günther <tom@toms-cafe.de>2009-06-06 23:17:58 +0200
commit2a4bf008cd0a14d53fefec0c34573aab12424373 (patch)
tree12ee1c3021b4965f095b5ea81ab3a60f01217449 /xml/skin.c
parent60cd7db51838bb076312fd10e08bca0f4a005f82 (diff)
parent3ab2393b6932b34e7f0e69af7f843d1303104d79 (diff)
downloadvdr-plugin-text2skin-2a4bf008cd0a14d53fefec0c34573aab12424373.tar.gz
vdr-plugin-text2skin-2a4bf008cd0a14d53fefec0c34573aab12424373.tar.bz2
Added chr13-optimizations (thanks to Christian Tusche / closes #39)
- increased efficiency in drawing list items in the main menu - introduce relative Pos and Size of objects to given BasePos, BaseSize (used to draw list items) - increase skin file version to 1.1 - the position of list items is interpreted relative to the "list" container when file version >= 1.1 - when a position is specified for "block" elements, the position of all contained elements is interpreted relative to the container position - selective update of changed objects refresh can be controlled for individual objects by the attributes "refresh" and "changed" default behaviour is to redraw everything (compatible with old skins) - moved state tracking of marquee, blink, scroll from cText2SkinRender to cxObject - fixed use of Update.Lock() in render.h - new: dynamic width/height of objects - new: Option "bgColor" used for items "Text", "Marquee", and "Blink". - remember period to next timeout when doing a non-timeout refresh prevent occasional start/stop of marquee-text
Diffstat (limited to 'xml/skin.c')
-rw-r--r--xml/skin.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/xml/skin.c b/xml/skin.c
index 6f3e938..2935dee 100644
--- a/xml/skin.c
+++ b/xml/skin.c
@@ -9,6 +9,37 @@
const std::string ScreenBases[] = { "relative", "absolute" };
+cxVersion::cxVersion(int ma, int min):
+ mMajor(ma),
+ mMinor(min)
+{
+}
+
+bool cxVersion::Parse(const std::string &Text)
+{
+ int dot = Text.find(".");
+ std::string ma(Text, 0, dot), min(Text, dot + 1);
+ char *e = NULL;
+ const char *t = NULL;
+ long l = 0;
+
+ t = ma.c_str();
+ l = strtol(t, &e, 10);
+ if (e == t || *e != '\0')
+ return false;
+ else
+ mMajor = l;
+
+ t = min.c_str();
+ l = strtol(t, &e, 10);
+ if (e == t || *e != '\0')
+ return false;
+ else
+ mMinor = l;
+
+ return true;
+}
+
cxSkin::cxSkin(const std::string &Name, cText2SkinI18n *I18n, cText2SkinTheme *Theme):
mName(Name),
mI18n(I18n),