summaryrefslogtreecommitdiff
path: root/textscroller.h
diff options
context:
space:
mode:
authorMartin Schirrmacher <vdr.skinflatplus@schirrmacher.eu>2014-06-23 22:02:32 +0200
committerMartin Schirrmacher <vdr.skinflatplus@schirrmacher.eu>2014-06-23 22:02:32 +0200
commit5cd4835c99818dd0174d52db91d9ef53ada96a99 (patch)
tree5e631017e6ebe6d1d7d17c7fb786e079be362fa9 /textscroller.h
parent52a6afcc01e8da9ea226e15e8d4e63c5573fbb48 (diff)
downloadskin-flatplus-5cd4835c99818dd0174d52db91d9ef53ada96a99.tar.gz
skin-flatplus-5cd4835c99818dd0174d52db91d9ef53ada96a99.tar.bz2
first text scroller support in channel info
Diffstat (limited to 'textscroller.h')
-rw-r--r--textscroller.h87
1 files changed, 87 insertions, 0 deletions
diff --git a/textscroller.h b/textscroller.h
new file mode 100644
index 00000000..5303cf87
--- /dev/null
+++ b/textscroller.h
@@ -0,0 +1,87 @@
+#pragma once
+
+#include <list>
+#include "flat.h"
+#include <string.h>
+#include <vdr/thread.h>
+
+#define WAITSTEPS 50
+
+class cTextScroll
+{
+private:
+ cRect Position;
+
+ tColor ColorFg, ColorBg;
+ std::string Text;
+ cFont *Font;
+ cPixmap *Pixmap;
+ cOsd *Osd;
+
+ int waitSteps;
+ bool isReserveStep;
+ bool ResetX;
+ int ScrollType;
+
+public:
+ cTextScroll(cOsd *osd, int type) {
+ Font = NULL;
+ Pixmap = NULL;
+ Osd = osd;
+
+ ScrollType = type;
+ isReserveStep = false;
+ waitSteps = WAITSTEPS;
+ ResetX = false;
+ }
+
+ ~cTextScroll() {
+ if( Pixmap ) {
+ Osd->DestroyPixmap(Pixmap);
+ Pixmap = NULL;
+ }
+ }
+
+/*
+ cTextScroll& operator=(const cTextScroll& other) {
+ if( this != &other ) {
+ this->Position = other.Position;
+ this->Text = other.Text;
+ this->ColorFg = other.ColorFg;
+ this->ColorBg = other.ColorBg;
+ this->Font = other.Font;
+ this->Pixmap = other.Pixmap;
+ this->Osd = other.Osd;
+ dsyslog("operator= pointer: %x", this->Pixmap);
+ }
+ return *this;
+ }
+*/
+ void Reset(void);
+ void SetText(const char *text, cRect position, tColor colorFg, tColor colorBg, cFont *font);
+ void DoStep(int Step);
+ void Draw(void);
+
+};
+
+class cTextScrollers : public cThread
+{
+private:
+ std::vector<cTextScroll *> Scrollers;
+
+ cOsd *Osd;
+ int scrollStep, scrollDelay;
+ int scrollType;
+
+ virtual void Action(void);
+public:
+ cTextScrollers();
+ ~cTextScrollers();
+
+ void Clear(void);
+ void SetOsd(cOsd *osd) { Osd = osd;}
+ void SetScrollStep(int step) { scrollStep = step; }
+ void SetScrollDelay(int delay) { scrollDelay = delay; }
+ void SetScrollType(int type) { scrollType = type; }
+ void AddScroller(const char *text, cRect position, tColor colorFg, tColor colorBg, cFont *font);
+};