From b32f1eaf9ae246f656ebd27c2fbb5d29d2bec34c Mon Sep 17 00:00:00 2001 From: Christian Tusche Date: Sun, 6 May 2007 17:26:51 +0200 Subject: 2007-05-06: Version 1.1-cvs_ext-0.10b (text2skin-1.1-cvs_ext-0.10b.diff) - 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 --- xml/skin.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'xml/skin.c') diff --git a/xml/skin.c b/xml/skin.c index 6f3e938..5578e1e 100644 --- a/xml/skin.c +++ b/xml/skin.c @@ -9,6 +9,40 @@ 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), -- cgit v1.2.3