diff options
Diffstat (limited to 'render.h')
-rw-r--r-- | render.h | 52 |
1 files changed, 26 insertions, 26 deletions
@@ -27,6 +27,7 @@ class cText2SkinRender: public cThread { friend class cText2SkinDisplayReplay; friend class cText2SkinDisplayMessage; friend class cText2SkinDisplayMenu; + friend class cText2SkinDisplayTracks; friend class cText2SkinStatus; @@ -47,7 +48,8 @@ private: tTokenCache mTokenCache; std::string mBasePath; - bool mDirty; + uint mDirty; // bit mask of required updates - set by SetDirty() + std::vector<int> mDirtyItems; uint mMaxItems; cSkin *mFallback; @@ -59,23 +61,15 @@ 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; - - // 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<uint,tState> tStates; - tStates mStates; - + + // scalefactor for tabs in the menu list + float mTabScale; + bool mTabScaleSet; + protected: // Update thread void UpdateLock(void) { mDoUpdateMutex.Lock(); } @@ -83,17 +77,22 @@ 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), const txSize &VirtSize = txSize(-1, -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, 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); @@ -121,7 +120,7 @@ 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<<type; } void Scroll(bool Up, bool Page) { if (mScroller != NULL) mScroller->Scroll(Up, Page); } void Clear(void) { DELETENULL(mScroller); } cSkin *Fallback(void) const { return mFallback; } @@ -168,14 +167,15 @@ public: inline void cText2SkinRender::Flush(bool Force) { - if (mDirty || Force) { - mTokenCache.clear(); + if (Force) + // do a full redraw + mDirty = (1 << cxRefresh::all); + if (mDirty > 0) { UpdateLock(); + mTokenCache.clear(); mDoUpdate.Broadcast(); UpdateUnlock(); - - mDirty = false; } } |