summaryrefslogtreecommitdiff
path: root/xml/skin.h
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.h
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.h')
-rw-r--r--xml/skin.h45
1 files changed, 42 insertions, 3 deletions
diff --git a/xml/skin.h b/xml/skin.h
index e27f87e..49656ea 100644
--- a/xml/skin.h
+++ b/xml/skin.h
@@ -15,6 +15,45 @@
class cText2SkinI18n;
class cText2SkinTheme;
+class cxVersion {
+public:
+ cxVersion(int ma = 0, int min = 0);
+ bool Parse(const std::string &Text);
+ int Major(void) const { return mMajor; }
+ int Minor(void) const { return mMinor; }
+ bool Require(int ma, int min) const {
+ return mMajor > ma ? true : (mMajor == ma ? mMinor >= min : false);
+ }
+ bool Limit(int ma, int min) const {
+ return mMajor < ma ? true : (mMajor == ma ? mMinor <= min : false);
+ }
+ bool operator==(const cxVersion &v) const {
+ return mMajor == v.mMajor && mMinor == v.mMinor;
+ }
+ bool operator>=(const cxVersion &v) const {
+ return Require(v.mMajor, v.mMinor);
+ }
+ bool operator>=(const char *c) const {
+ cxVersion v;
+ if (!v.Parse(c))
+ return false;
+ return Require(v.mMajor, v.mMinor);
+ }
+ bool operator<=(const cxVersion &v) const {
+ return Limit(v.mMajor, v.mMinor);
+ }
+ bool operator<=(const char *c) const {
+ cxVersion v;
+ if (!v.Parse(c))
+ return false;
+ return Limit(v.mMajor, v.mMinor);
+ }
+
+private:
+ int mMajor;
+ int mMinor;
+};
+
class cxSkin {
friend bool xStartElem(const std::string &name, std::map<std::string,std::string> &attrs);
friend bool xEndElem(const std::string &name);
@@ -35,8 +74,8 @@ private:
txSize mBaseSize;
std::string mName;
std::string mTitle;
- std::string mVersion;
-
+ cxVersion mVersion;
+
cxDisplays mDisplays;
cText2SkinI18n *mI18n; // TODO: should move here completely
@@ -55,7 +94,7 @@ public:
const txSize &BaseSize(void) const { return mBaseSize; }
const std::string &Name(void) const { return mName; }
const std::string &Title(void) const { return mTitle; }
- const std::string &Version(void) const { return mVersion; }
+ const cxVersion &Version(void) const { return mVersion; }
// functions for object classes to obtain dynamic item information
std::string Translate(const std::string &Text);