From 0b3f86344a87940d324695e0bc9449c35cbf60d4 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.10a (text2skin-1.1-cvs_ext-0.10a.diff) - 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) --- xml/display.h | 2 +- xml/object.c | 23 +++++++++++++++-------- xml/object.h | 10 +++++----- 3 files changed, 21 insertions(+), 14 deletions(-) (limited to 'xml') diff --git a/xml/display.h b/xml/display.h index 319cc7e..a9b2080 100644 --- a/xml/display.h +++ b/xml/display.h @@ -48,7 +48,7 @@ public: cxSkin *Skin(void) const { return mSkin; } uint Objects(void) const { return mObjects.size(); } - const cxObject *GetObject(int n) const { return mObjects[n]; } + cxObject *GetObject(int n) const { return mObjects[n]; } }; class cxDisplays: public std::map { diff --git a/xml/object.c b/xml/object.c index c63c2ea..81dc854 100644 --- a/xml/object.c +++ b/xml/object.c @@ -155,18 +155,25 @@ const cFont *cxObject::Font(void) const return cFont::GetFont(fontOsd); } -txPoint cxObject::Pos(void) const +txPoint cxObject::Pos(const txPoint &BaseOffset, const txSize &BaseSize) const { - return txPoint(mSkin->BaseOffset().x + (mPos1.x < 0 ? Skin()->BaseSize().w + mPos1.x : mPos1.x), - mSkin->BaseOffset().y + (mPos1.y < 0 ? Skin()->BaseSize().h + mPos1.y : mPos1.y)); + txPoint bOffset = BaseOffset.x < 0 ? mSkin->BaseOffset() : BaseOffset; + txSize bSize = BaseSize.w < 0 ? mSkin->BaseSize() : BaseSize; + + return txPoint(bOffset.x + (mPos1.x < 0 ? bSize.w + mPos1.x : mPos1.x), + bOffset.y + (mPos1.y < 0 ? bSize.h + mPos1.y : mPos1.y)); } -txSize cxObject::Size(void) const +txSize cxObject::Size(const txPoint &BaseOffset, const txSize &BaseSize) const { - txPoint p1(mSkin->BaseOffset().x + (mPos1.x < 0 ? Skin()->BaseSize().w + mPos1.x : mPos1.x), - mSkin->BaseOffset().y + (mPos1.y < 0 ? Skin()->BaseSize().h + mPos1.y : mPos1.y)); - txPoint p2(mSkin->BaseOffset().x + (mPos2.x < 0 ? Skin()->BaseSize().w + mPos2.x : mPos2.x), - mSkin->BaseOffset().y + (mPos2.y < 0 ? Skin()->BaseSize().h + mPos2.y : mPos2.y)); + txPoint bOffset = BaseOffset.x < 0 ? mSkin->BaseOffset() : BaseOffset; + txSize bSize = BaseSize.w < 0 ? mSkin->BaseSize() : BaseSize; + + txPoint p1(bOffset.x + (mPos1.x < 0 ? bSize.w + mPos1.x : mPos1.x), + bOffset.y + (mPos1.y < 0 ? bSize.h + mPos1.y : mPos1.y)); + txPoint p2(bOffset.x + (mPos2.x < 0 ? bSize.w + mPos2.x : mPos2.x), + bOffset.y + (mPos2.y < 0 ? bSize.h + mPos2.y : mPos2.y)); + return txSize(p2.x - p1.x + 1, p2.y - p1.y + 1); } diff --git a/xml/object.h b/xml/object.h index bbc37a0..603019f 100644 --- a/xml/object.h +++ b/xml/object.h @@ -61,7 +61,7 @@ public: item, #define __COUNT_OBJECT__ (item + 1) }; - + private: cxDisplay *mDisplay; cxSkin *mSkin; @@ -118,8 +118,8 @@ public: cxSkin *Skin(void) const { return mSkin; } const std::string &TypeName(void) const; - txPoint Pos(void) const; - txSize Size(void) const; + txPoint Pos(const txPoint &BaseOffset=txPoint(-1,-1), const txSize &BaseSize=txSize(-1,-1)) const; + txSize Size(const txPoint &BaseOffset=txPoint(-1,-1), const txSize &BaseSize=txSize(-1,-1)) const; const cFont *Font(void) const; const tColor *Fg(void) const; const tColor *Bg(void) const; @@ -129,7 +129,7 @@ public: const tColor *Keep(void) const; uint Objects(void) const; - const cxObject *GetObject(uint Index) const; + cxObject *GetObject(uint Index) const; }; class cxObjects: public std::vector { @@ -144,7 +144,7 @@ inline uint cxObject::Objects(void) const return mObjects ? mObjects->size() : 0; } -inline const cxObject *cxObject::GetObject(uint Index) const +inline cxObject *cxObject::GetObject(uint Index) const { return mObjects ? (*mObjects)[Index] : NULL; } -- cgit v1.2.3 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/parser.c | 4 ++-- xml/skin.c | 34 ++++++++++++++++++++++++++++++++++ xml/skin.h | 42 ++++++++++++++++++++++++++++++++++++++++-- 3 files changed, 76 insertions(+), 4 deletions(-) (limited to 'xml') diff --git a/xml/parser.c b/xml/parser.c index f573398..0045af1 100644 --- a/xml/parser.c +++ b/xml/parser.c @@ -45,7 +45,7 @@ #define ATTRIB_OPT_NUMBER(_attr,_target) \ if (attrs.find(_attr) != attrs.end()) { \ char *_e; const char *_t = attrs[_attr].c_str(); \ - long _l = strtol(_t, &_e, 10); \ + long _l = strtol(_t, &_e, 0); \ if (_e ==_t || *_e != '\0') { \ esyslog("ERROR: Text2Skin: Invalid numeric value \"%s\" in attribute %s", \ _t, _attr); \ @@ -91,7 +91,7 @@ bool xStartElem(const std::string &name, std::map &attr if (context.size() == 0) { if (name == "skin") { - ATTRIB_MAN_STRING("version", skin->mVersion); + ATTRIB_MAN_FUNC ("version", skin->mVersion.Parse); ATTRIB_MAN_STRING("name", skin->mTitle); ATTRIB_MAN_FUNC ("screenBase", skin->ParseBase); } 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), diff --git a/xml/skin.h b/xml/skin.h index e27f87e..4613199 100644 --- a/xml/skin.h +++ b/xml/skin.h @@ -15,6 +15,44 @@ 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 cxVersion::operator==( const cxVersion &v ) const { + return mMajor == v.mMajor && mMinor == v.mMinor; + } + bool cxVersion::operator>=( const cxVersion &v ) const { + return Require( v.mMajor , v.mMinor); + } + bool cxVersion::operator>=( const char *c ) const { + cxVersion v; + if( !v.Parse(c) ) return false; + return Require( v.mMajor , v.mMinor); + } + bool cxVersion::operator<=( const cxVersion &v ) const { + return Limit( v.mMajor , v.mMinor ); + } + bool cxVersion::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 &attrs); friend bool xEndElem(const std::string &name); @@ -35,7 +73,7 @@ private: txSize mBaseSize; std::string mName; std::string mTitle; - std::string mVersion; + cxVersion mVersion; cxDisplays mDisplays; @@ -55,7 +93,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); -- cgit v1.2.3 From f6f140b2ea0bb1de9e055e920ef9c0c43c6e2add 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.10c (text2skin-1.1-cvs_ext-0.10c.diff) - 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) --- xml/display.c | 3 +- xml/display.h | 1 + xml/object.c | 114 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ xml/object.h | 35 ++++++++++++++++++ xml/parser.c | 23 +++++++++++- 5 files changed, 174 insertions(+), 2 deletions(-) (limited to 'xml') diff --git a/xml/display.c b/xml/display.c index a8268c4..adf500b 100644 --- a/xml/display.c +++ b/xml/display.c @@ -11,7 +11,8 @@ static const std::string DisplayNames[] = cxDisplay::cxDisplay(cxSkin *parent): mSkin(parent), mType((eType)__COUNT_DISPLAY__), - mNumWindows(0) + mNumWindows(0), + mRefreshDefault(NULL) { } diff --git a/xml/display.h b/xml/display.h index a9b2080..af1f590 100644 --- a/xml/display.h +++ b/xml/display.h @@ -35,6 +35,7 @@ private: int mNumWindows; int mNumMarquees; cxObjects mObjects; + cxRefresh mRefreshDefault; public: cxDisplay(cxSkin *Parent); diff --git a/xml/object.c b/xml/object.c index 81dc854..587eab5 100644 --- a/xml/object.c +++ b/xml/object.c @@ -30,6 +30,7 @@ cxObject::cxObject(cxDisplay *Parent): mFontWidth(0), mDelay(150), mIndex(0), + mRefresh(this), mObjects(NULL) { } @@ -59,6 +60,7 @@ cxObject::cxObject(const cxObject &Src): mFontSize(Src.mFontSize), mFontWidth(Src.mFontWidth), mDelay(Src.mDelay), + mRefresh(Src.mRefresh), mObjects(NULL) { if (Src.mCondition) @@ -223,3 +225,115 @@ cxObjects::~cxObjects() delete operator[](i); } + + + + + +cxRefresh::cxRefresh( cxObject *Object ): + mRefreshType(0xFF), + mText(NULL), + mChanged(NULL), + mObject(Object), + mForce(true), + mFull(true) +{ +} + +cxRefresh::~cxRefresh() +{ + delete mText; +} + +bool cxRefresh::Dirty(uint dirty, bool force) +{ + bool need_changed = !mForce && !force && !(mRefreshType & dirty & ~(1<Evaluate(); + + if( mEval == mLastEval && need_changed ) { + return false; + } else { + mLastEval = mEval; + } + + return true; +} + + + + + +bool cxRefresh::Parse(const std::string &Text) +{ + uint refresh=0; + bool force=false, full=false; + + if( Text.find("all") != std::string::npos ) + refresh |= (1<Parse(Text) ) { + mChanged = mText; + return true; + } + + return false; +} + +cxRefresh &cxRefresh::operator=(const cxRefresh &a) +{ + mRefreshType = a.mRefreshType; + mForce = a.mForce; + mFull = a.mFull; + return *this; +} diff --git a/xml/object.h b/xml/object.h index 603019f..7a37b5c 100644 --- a/xml/object.h +++ b/xml/object.h @@ -33,6 +33,40 @@ struct txWindow { pos1(_x1, _y2), pos2(_x2, _y2), bpp(_bpp) {} }; +class cxObject; + +class cxRefresh { + friend bool xEndElem(const std::string &name); + +public: + enum eRefreshType { + all, // complete redraw of the screen + timeout, // redraw due to a timeout + //message, // a message was set or removed + update, // update of the osd elements + scroll, // a scroll event + list, // list items or the current item have changed + }; + + cxRefresh(cxObject *Object); + ~cxRefresh(); + bool Dirty(uint dirty, bool force=false); + bool Full(void) const { return mFull; } + uint Type(void) const { return mRefreshType; } + bool Parse(const std::string &Text); + bool ParseChanged(const std::string &Text); + cxRefresh &cxRefresh::operator=(const cxRefresh &b); + +private: + uint mRefreshType; + cxType mLastEval; + cxType mEval; + cxString *mText; + cxString *mChanged; + cxObject *mObject; + bool mForce, mFull; +}; + class cxObjects; class cxObject { @@ -88,6 +122,7 @@ private: int mFontWidth; uint mDelay; uint mIndex; + cxRefresh mRefresh; cxObjects *mObjects; // used for block objects such as public: diff --git a/xml/parser.c b/xml/parser.c index 0045af1..1e3ed73 100644 --- a/xml/parser.c +++ b/xml/parser.c @@ -102,6 +102,7 @@ bool xStartElem(const std::string &name, std::map &attr if (name == "display") { display = new cxDisplay(skin); ATTRIB_MAN_FUNC ("id", display->ParseType); + ATTRIB_OPT_FUNC ("refresh", display->mRefreshDefault.Parse); } else TAG_ERR_REMAIN("skin"); @@ -129,12 +130,18 @@ bool xStartElem(const std::string &name, std::map &attr else { object = new cxObject(display); if (object->ParseType(name)) { + if(parents.size() > 0) + object->mRefresh = parents.back()->mRefresh; + else + object->mRefresh = display->mRefreshDefault; + ATTRIB_OPT_NUMBER("x1", object->mPos1.x); ATTRIB_OPT_NUMBER("y1", object->mPos1.y); ATTRIB_OPT_NUMBER("x2", object->mPos2.x); ATTRIB_OPT_NUMBER("y2", object->mPos2.y); ATTRIB_OPT_FUNC ("condition", object->ParseCondition); - + ATTRIB_OPT_FUNC ("refresh", object->mRefresh.Parse); + ATTRIB_OPT_FUNC ("changed", object->mRefresh.ParseChanged); if (name == "image") { ATTRIB_OPT_NUMBER("x", object->mPos1.x); ATTRIB_OPT_NUMBER("y", object->mPos1.y); @@ -256,6 +263,20 @@ bool xEndElem(const std::string &name) { } } + if (object->mRefresh.mChanged == NULL) { + switch (object->mType) { + case cxObject::text: + case cxObject::marquee: + case cxObject::blink: + case cxObject::scrolltext: + object->mRefresh.mChanged = &object->mText; + break; + + default: + break; + } + } + object->mIndex = oindex++; if (parents.size() > 0) { Dprintf("pushing to parent\n"); -- cgit v1.2.3 From 3ab2393b6932b34e7f0e69af7f843d1303104d79 Mon Sep 17 00:00:00 2001 From: Christian Tusche Date: Sun, 29 Jul 2007 19:01:17 +0200 Subject: 2007-07-29: Version 1.1-cvs_ext-0.11 (text2skin-1.1-cvs_ext-0.11.diff) - moved state tracking of marquee, blink, scroll from cText2SkinRender to cxObject - fixed compatibility with gcc-4 and vdr-1.5.x - 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 --- xml/object.c | 111 +++++++++++++++++++++++++++++++++++++++++++++-------------- xml/object.h | 49 +++++++++++++++++++++++--- xml/parser.c | 6 +++- xml/skin.h | 10 +++--- 4 files changed, 140 insertions(+), 36 deletions(-) (limited to 'xml') diff --git a/xml/object.c b/xml/object.c index 587eab5..eae47e5 100644 --- a/xml/object.c +++ b/xml/object.c @@ -16,6 +16,7 @@ cxObject::cxObject(cxDisplay *Parent): mType((eType)__COUNT_OBJECT__), mPos1(0, 0), mPos2(-1, -1), + mVirtSize(-1,-1), mAlpha(255), mColors(0), mArc(0), @@ -31,7 +32,8 @@ cxObject::cxObject(cxDisplay *Parent): mDelay(150), mIndex(0), mRefresh(this), - mObjects(NULL) + mObjects(NULL), + mListIndex(0) { } @@ -41,11 +43,13 @@ cxObject::cxObject(const cxObject &Src): mType(Src.mType), mPos1(Src.mPos1), mPos2(Src.mPos2), + mVirtSize(Src.mVirtSize), mAlpha(Src.mAlpha), mColors(Src.mColors), mArc(Src.mArc), mFg(Src.mFg), mBg(Src.mBg), + mBl(Src.mBl), mMask(Src.mMask), mMark(Src.mMark), mActive(Src.mActive), @@ -61,7 +65,8 @@ cxObject::cxObject(const cxObject &Src): mFontWidth(Src.mFontWidth), mDelay(Src.mDelay), mRefresh(Src.mRefresh), - mObjects(NULL) + mObjects(NULL), + mListIndex(Src.mListIndex) { if (Src.mCondition) mCondition = new cxFunction(*Src.mCondition); @@ -130,7 +135,8 @@ bool cxObject::ParseFontFace(const std::string &Text) void cxObject::SetListIndex(uint Index, int Tab) { - mIndex = mDisplay->Objects() + (Index * cSkinDisplayMenu::MaxTabs + Tab); + Tab = Tab>=0 ? Tab : -1; + mListIndex = 1 + Index * cSkinDisplayMenu::MaxTabs + Tab; mText.SetListIndex(Index, Tab); mPath.SetListIndex(Index, Tab); if (mCondition != NULL) @@ -157,24 +163,38 @@ const cFont *cxObject::Font(void) const return cFont::GetFont(fontOsd); } -txPoint cxObject::Pos(const txPoint &BaseOffset, const txSize &BaseSize) const +txPoint cxObject::Pos(const txPoint &BaseOffset, const txSize &BaseSize, const txSize &VirtSize) const { txPoint bOffset = BaseOffset.x < 0 ? mSkin->BaseOffset() : BaseOffset; txSize bSize = BaseSize.w < 0 ? mSkin->BaseSize() : BaseSize; - return txPoint(bOffset.x + (mPos1.x < 0 ? bSize.w + mPos1.x : mPos1.x), - bOffset.y + (mPos1.y < 0 ? bSize.h + mPos1.y : mPos1.y)); + double scale_x = VirtSize.w>0 ? (double)BaseSize.w / VirtSize.w : 1.0, + scale_y = VirtSize.h>0 ? (double)BaseSize.h / VirtSize.h : 1.0; + + int x1 = mPos1.x < 0 ? (int)((mPos1.x + 1) * scale_x - 1) : (int)(mPos1.x * scale_x); + int y1 = mPos1.y < 0 ? (int)((mPos1.y + 1) * scale_x - 1) : (int)(mPos1.y * scale_y); + + return txPoint(bOffset.x + (x1 < 0 ? bSize.w + x1 : x1), + bOffset.y + (y1 < 0 ? bSize.h + y1 : y1)); } -txSize cxObject::Size(const txPoint &BaseOffset, const txSize &BaseSize) const +txSize cxObject::Size(const txPoint &BaseOffset, const txSize &BaseSize, const txSize &VirtSize) const { - txPoint bOffset = BaseOffset.x < 0 ? mSkin->BaseOffset() : BaseOffset; + //txPoint bOffset = BaseOffset.x < 0 ? mSkin->BaseOffset() : BaseOffset; txSize bSize = BaseSize.w < 0 ? mSkin->BaseSize() : BaseSize; - txPoint p1(bOffset.x + (mPos1.x < 0 ? bSize.w + mPos1.x : mPos1.x), - bOffset.y + (mPos1.y < 0 ? bSize.h + mPos1.y : mPos1.y)); - txPoint p2(bOffset.x + (mPos2.x < 0 ? bSize.w + mPos2.x : mPos2.x), - bOffset.y + (mPos2.y < 0 ? bSize.h + mPos2.y : mPos2.y)); + double scale_x = VirtSize.w>0 ? (double)BaseSize.w / VirtSize.w : 1.0, + scale_y = VirtSize.h>0 ? (double)BaseSize.h / VirtSize.h : 1.0; + + int x1 = mPos1.x < 0 ? (int)((mPos1.x + 1) * scale_x - 1) : (int)(mPos1.x * scale_x); + int y1 = mPos1.y < 0 ? (int)((mPos1.y + 1) * scale_x - 1) : (int)(mPos1.y * scale_y); + int x2 = mPos2.x < 0 ? (int)((mPos2.x + 1) * scale_x - 1) : (int)(mPos2.x * scale_x); + int y2 = mPos2.y < 0 ? (int)((mPos2.y + 1) * scale_x - 1) : (int)(mPos2.y * scale_y); + + txPoint p1(x1 < 0 ? bSize.w + x1 : x1, + y1 < 0 ? bSize.h + y1 : y1); + txPoint p2(x2 < 0 ? bSize.w + x2 : x2, + y2 < 0 ? bSize.h + y2 : y2); return txSize(p2.x - p1.x + 1, p2.y - p1.y + 1); } @@ -191,6 +211,12 @@ const tColor *cxObject::Bg(void) const return cText2SkinRender::ItemColor(mBg, Bg) ? &Bg : NULL; } +const tColor *cxObject::Bl(void) const +{ + static tColor Bl; + return cText2SkinRender::ItemColor(mBl, Bl) ? &Bl : NULL; +} + const tColor *cxObject::Mask(void) const { static tColor Mask; @@ -230,6 +256,11 @@ cxObjects::~cxObjects() + + +/////////////////////////////////////////////////////////////////////////////// +// ---------- class cxRefresh ---------------------------------------------- // + cxRefresh::cxRefresh( cxObject *Object ): mRefreshType(0xFF), mText(NULL), @@ -245,27 +276,55 @@ cxRefresh::~cxRefresh() delete mText; } -bool cxRefresh::Dirty(uint dirty, bool force) +bool cxRefresh::Dirty(uint dirty, uint &updatein, bool force, uint now) { - bool need_changed = !mForce && !force && !(mRefreshType & dirty & ~(1<State().nexttime; + + bool to = force || mForce || + mObject->Type() == cxObject::block || mObject->Type() == cxObject::list; + bool changed = force || mForce; + + if( now>0 && nexttime>0 ) { + // timeout was set + if( now >= nexttime ) { + // timeout has expired + to = true; + } else { + // time left -> set new update interval + uint nextin = nexttime - now; + if (updatein == 0 || nextin < updatein) + updatein = nextin; + } + } - if( !(mRefreshType & dirty) ) - return false; + // Objaect has changed since last redraw + if( mChanged != NULL ) { + mEval = mChanged->Evaluate(); + if( mEval != mLastEval ) { + changed = true; + } + } - if( mChanged == NULL && need_changed ) - return false; - else if( mChanged == NULL ) + // refresh + if( (mRefreshType & dirty & ~(1<Evaluate(); - - if( mEval == mLastEval && need_changed ) { - return false; - } else { - mLastEval = mEval; + // timeout + if( (mRefreshType & dirty & (1< + // state information for marquee, blink, scroll + uint mListIndex; + typedef std::map tStates; + tStates mStates; + + public: cxObject(cxDisplay *parent); cxObject(const cxObject &Src); @@ -151,13 +188,17 @@ public: uint Index(void) const { return mIndex; } cxDisplay *Display(void) const { return mDisplay; } cxSkin *Skin(void) const { return mSkin; } + txState &State(void) { return mStates[mListIndex]; } const std::string &TypeName(void) const; - txPoint Pos(const txPoint &BaseOffset=txPoint(-1,-1), const txSize &BaseSize=txSize(-1,-1)) const; - txSize Size(const txPoint &BaseOffset=txPoint(-1,-1), const txSize &BaseSize=txSize(-1,-1)) const; + txPoint Pos(const txPoint &BaseOffset=txPoint(-1,-1), const txSize &BaseSize=txSize(-1,-1), + const txSize &VirtSize=txSize(-1,-1) ) const; + txSize Size(const txPoint &BaseOffset=txPoint(-1,-1), const txSize &BaseSize=txSize(-1,-1), + const txSize &VirtSize=txSize(-1,-1)) const; const cFont *Font(void) const; const tColor *Fg(void) const; const tColor *Bg(void) const; + const tColor *Bl(void) const; const tColor *Mask(void) const; const tColor *Mark(void) const; const tColor *Active(void) const; diff --git a/xml/parser.c b/xml/parser.c index 1e3ed73..158724a 100644 --- a/xml/parser.c +++ b/xml/parser.c @@ -159,11 +159,12 @@ bool xStartElem(const std::string &name, std::map &attr || name == "blink" || name == "scrolltext") { ATTRIB_OPT_STRING("color", object->mFg); + ATTRIB_OPT_STRING("bgColor", object->mBg); ATTRIB_OPT_FUNC ("align", object->ParseAlignment); ATTRIB_OPT_FUNC ("font", object->ParseFontFace); if (name == "blink") { - ATTRIB_OPT_STRING("blinkColor", object->mBg); + ATTRIB_OPT_STRING("blinkColor", object->mBl); ATTRIB_OPT_NUMBER("delay", object->mDelay); if (object->mDelay == 0) @@ -196,6 +197,9 @@ bool xStartElem(const std::string &name, std::map &attr else if (name == "item") { ATTRIB_MAN_NUMBER("height", object->mPos2.y); --object->mPos2.y; + } else if (name == "block" || name == "list") { + ATTRIB_OPT_NUMBER("w", object->mVirtSize.w); + ATTRIB_OPT_NUMBER("h", object->mVirtSize.h); } } else TAG_ERR_REMAIN(context[context.size() - 1].c_str()); diff --git a/xml/skin.h b/xml/skin.h index 4613199..69d96e6 100644 --- a/xml/skin.h +++ b/xml/skin.h @@ -28,21 +28,21 @@ public: bool Limit( int ma, int min ) const { return mMajor < ma ? true : (mMajor == ma ? mMinor <= min : false); } - bool cxVersion::operator==( const cxVersion &v ) const { + bool operator==( const cxVersion &v ) const { return mMajor == v.mMajor && mMinor == v.mMinor; } - bool cxVersion::operator>=( const cxVersion &v ) const { + bool operator>=( const cxVersion &v ) const { return Require( v.mMajor , v.mMinor); } - bool cxVersion::operator>=( const char *c ) const { + bool operator>=( const char *c ) const { cxVersion v; if( !v.Parse(c) ) return false; return Require( v.mMajor , v.mMinor); } - bool cxVersion::operator<=( const cxVersion &v ) const { + bool operator<=( const cxVersion &v ) const { return Limit( v.mMajor , v.mMinor ); } - bool cxVersion::operator<=( const char *c ) const { + bool operator<=( const char *c ) const { cxVersion v; if( !v.Parse(c) ) return false; return Limit( v.mMajor , v.mMinor); -- cgit v1.2.3