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) --- render.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'render.h') diff --git a/render.h b/render.h index cee31ab..c51bed7 100644 --- a/render.h +++ b/render.h @@ -27,6 +27,7 @@ class cText2SkinRender: public cThread { friend class cText2SkinDisplayReplay; friend class cText2SkinDisplayMessage; friend class cText2SkinDisplayMenu; + friend class cText2SkinDisplayTracks; friend class cText2SkinStatus; @@ -75,6 +76,10 @@ private: }; typedef std::map tStates; tStates mStates; + + // scalefactor for tabs in the menu list + float mTabScale; + bool mTabScaleSet; protected: // Update thread @@ -83,7 +88,11 @@ protected: virtual void Action(void); // Drawing operations - void DrawObject(const cxObject *Object); + void DrawObject(cxObject *Object, const txPoint &BaseOffset=txPoint(-1,-1), + const txSize &BaseSize=txSize(-1,-1), + int ListItem=-1 ); + void DrawItemText(cxObject *o, int i, const txPoint &ListOffset, const txSize &ListSize); + void DrawBackground(const txPoint &Pos, const txSize &Size, const tColor *Bg, const tColor *Fg, int Alpha, const std::string &Path); void DrawImage(const txPoint &Pos, const txSize &Size, const tColor *Bg, const tColor *Fg, -- 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) --- render.h | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'render.h') diff --git a/render.h b/render.h index c51bed7..241e908 100644 --- a/render.h +++ b/render.h @@ -48,7 +48,8 @@ private: tTokenCache mTokenCache; std::string mBasePath; - bool mDirty; + uint mDirty; // bit mask of required updates - set by SetDirty() + std::vector mDirtyItems; uint mMaxItems; cSkin *mFallback; @@ -60,6 +61,7 @@ private: cCondVar mStarted; uint mUpdateIn; uint mNow; // timestamp to calculate update timings + bool mFirst; // First drawing of the display -> draw everything // coordinate transformation txSize mBaseSize; @@ -90,7 +92,7 @@ protected: // Drawing operations void DrawObject(cxObject *Object, const txPoint &BaseOffset=txPoint(-1,-1), const txSize &BaseSize=txSize(-1,-1), - int ListItem=-1 ); + int ListItem=-1, bool ForceUpdate=false); void DrawItemText(cxObject *o, int i, const txPoint &ListOffset, const txSize &ListSize); void DrawBackground(const txPoint &Pos, const txSize &Size, const tColor *Bg, const tColor *Fg, @@ -130,7 +132,8 @@ protected: // functions for display renderer to control behaviour void Flush(bool Force = false); - void SetDirty(void) { mDirty = true; } + void SetDirty( cxRefresh::eRefreshType type=cxRefresh::all) { + mDirty |= 1<Scroll(Up, Page); } void Clear(void) { DELETENULL(mScroller); } cSkin *Fallback(void) const { return mFallback; } @@ -179,14 +182,17 @@ public: inline void cText2SkinRender::Flush(bool Force) { - if (mDirty || Force) { + if( Force ) { + // do a full redraw + mDirty = (1 << cxRefresh::all); + } + + if (mDirty>0) { mTokenCache.clear(); UpdateLock(); mDoUpdate.Broadcast(); UpdateUnlock(); - - mDirty = false; } } -- 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 --- render.h | 29 ++++++++--------------------- 1 file changed, 8 insertions(+), 21 deletions(-) (limited to 'render.h') diff --git a/render.h b/render.h index 241e908..f788168 100644 --- a/render.h +++ b/render.h @@ -65,19 +65,6 @@ private: // coordinate transformation txSize mBaseSize; - - // state information for marquee, blink, scroll - struct tState { - bool scrolling; - int offset; - int direction; - uint nexttime; - std::string text; - - tState(void): scrolling(false), offset(0), direction(1), nexttime(0) {} - }; - typedef std::map tStates; - tStates mStates; // scalefactor for tabs in the menu list float mTabScale; @@ -91,7 +78,7 @@ protected: // Drawing operations void DrawObject(cxObject *Object, const txPoint &BaseOffset=txPoint(-1,-1), - const txSize &BaseSize=txSize(-1,-1), + const txSize &BaseSize=txSize(-1,-1), const txSize &VirtSize=txSize(-1,-1), int ListItem=-1, bool ForceUpdate=false); void DrawItemText(cxObject *o, int i, const txPoint &ListOffset, const txSize &ListSize); @@ -99,12 +86,13 @@ protected: int Alpha, const std::string &Path); void DrawImage(const txPoint &Pos, const txSize &Size, const tColor *Bg, const tColor *Fg, const tColor *Mask, int Alpha, int Colors, const std::string &Path); - void DrawText(const txPoint &Pos, const txSize &Size, const tColor *Fg, const std::string &Text, - const cFont *Font, int Align); - void DrawMarquee(const txPoint &Pos, const txSize &Size, const tColor *Fg, - const std::string &Text, const cFont *Font, int Align, uint Delay, uint Index); + void DrawText(const txPoint &Pos, const txSize &Size, const tColor *Fg, const tColor *Bg, + const std::string &Text, const cFont *Font, int Align); + void DrawMarquee(const txPoint &Pos, const txSize &Size, const tColor *Fg, const tColor *Bg, + const std::string &Text, const cFont *Font, int Align, uint Delay, txState &state); void DrawBlink(const txPoint &Pos, const txSize &Size, const tColor *Fg, const tColor *Bg, - const std::string &Text, const cFont *Font, int Align, uint Delay, uint Index); + const tColor *Bl, const std::string &Text, const cFont *Font, int Align, + uint Delay, txState &state); void DrawRectangle(const txPoint &Pos, const txSize &Size, const tColor *Fg); void DrawEllipse(const txPoint &Pos, const txSize &Size, const tColor *Fg, int Arc); void DrawSlope(const txPoint &Pos, const txSize &Size, const tColor *Fg, int Arc); @@ -188,9 +176,8 @@ inline void cText2SkinRender::Flush(bool Force) } if (mDirty>0) { - mTokenCache.clear(); - UpdateLock(); + mTokenCache.clear(); mDoUpdate.Broadcast(); UpdateUnlock(); } -- cgit v1.2.3