summaryrefslogtreecommitdiff
path: root/texteffects.h
diff options
context:
space:
mode:
authorAndreas Mair <amair.sob@googlemail.com>2007-06-11 12:57:02 +0200
committerAndreas Mair <amair.sob@googlemail.com>2007-06-11 12:57:02 +0200
commit24439e72e8b0d13bccce21e19a28d70d1bd98760 (patch)
tree40114ac9918d904e640900e3845f65243a2319ac /texteffects.h
parentc562d549bc6274265991eec634f99b1e311323df (diff)
downloadvdr-plugin-skinenigmang-24439e72e8b0d13bccce21e19a28d70d1bd98760.tar.gz
vdr-plugin-skinenigmang-24439e72e8b0d13bccce21e19a28d70d1bd98760.tar.bz2
2007-06-11: Version 0.0.5rcv0.0.5rc
- Fixed possible crash in recording's details. - Added MoBuntu theme (Submitted by Morone @vdr-portal.de). - Added Blue, Blue2, Blue3 and Coolblue theme (Submitted by Uwe @vdr-portal.de). - Added support for TrueTypeFonts (based on graphtft and text2skin plugins). - Added support for new epgsearch tags. - Updated French translation. (Submitted by pat @vdr-portal.de) - Changed size calculation for scrollbars. - Add setup options to individually set the fonts to use. See README for details. - Set used colors for every area in menu OSD when using multiple areas. - Reworked multiple areas mode in menu OSD. - Do not disable logos/symbols/flags if 4bpp single area is configured in setup. - Replaced setup options "One area (if possible)" and "Bpp in single area" by option "Try 8bpp single areas". - Unified appearance of error/info/status messages in all OSDs. - Added setup option to selectively enable scrolling text. - Added setup option to selectively enable logos in the different OSDs. - Added text effects (e.g. scrolling and blinking) for selected text. - Removed clrMenuHighlight, clrMessageBorder, clrMenuItemCurrentFg, clrMenuEventTitle, clrMenuEventShortText, clrMenuScrollbarTotal and clrMenuScrollbarShown in themes. - Fixed height of title/subtitle box in EPG & recording details. - Recognize mediamanager plugin in mainmenu logos. - Don't cut info line in EPG & recording details at logo area's left edge. - Updated Russian translation (Submitted by neptunvasja @vdr-portal.de). - Added Dutch translation (Submitted by dorpsgek @vdr-portal.de). - Various bugfixes and graphical changes.
Diffstat (limited to 'texteffects.h')
-rw-r--r--texteffects.h148
1 files changed, 148 insertions, 0 deletions
diff --git a/texteffects.h b/texteffects.h
new file mode 100644
index 0000000..eb6dd8a
--- /dev/null
+++ b/texteffects.h
@@ -0,0 +1,148 @@
+/*
+ * status.h: 'EnigmaNG' skin for the Video Disk Recorder
+ *
+ * See the README file for copyright information and how to reach the author.
+ *
+ */
+
+#ifndef __TEXTEFFECTS_H
+#define __TEXTEFFECTS_H
+
+#include "common.h"
+#include "enigma.h"
+
+#ifndef DISABLE_ANIMATED_TEXT
+#include <vector>
+#endif
+
+#include <vdr/skins.h>
+
+#ifdef DISABLE_ANIMATED_TEXT
+#define TE_START(osd) ;
+#define TE_STOP ;
+#define TE_LOCK ;
+#define TE_UNLOCK ;
+#define TE_WAKEUP ;
+#define TE_MARQUEE(osd, id, x...) osd->DrawText(x)
+#define TE_BLINK(osd, id, x...) osd->DrawText(x)
+#define TE_TITLE(osd, id, s, Font, Width, skin) osd->DrawTitle(s)
+
+#else // !DISABLE_ANIMATED_TEXT
+#include <vdr/thread.h>
+
+#define TE_START(osd) EnigmaTextEffects.Start(osd);
+#define TE_STOP EnigmaTextEffects.Stop();
+#define TE_LOCK EnigmaTextEffects.UpdateLock();
+#define TE_UNLOCK EnigmaTextEffects.UpdateUnlock();
+#define TE_WAKEUP EnigmaTextEffects.RefreshEffects();
+#define TE_MARQUEE(osd, id, x...) EnigmaTextEffects.DrawAnimatedText(id, 0, x)
+#define TE_BLINK(osd, id, x...) EnigmaTextEffects.DrawAnimatedText(id, 1, x)
+#define TE_TITLE(osd, id, x...) EnigmaTextEffects.DrawAnimatedTitle(id, 0, x)
+
+#endif //DISABLE_ANIMATED_TEXT
+
+#ifdef DISABLE_ANIMATED_TEXT
+class cEnigmaTextEffects {
+#else
+class cEnigmaTextEffects : public cThread {
+#endif
+private:
+ cOsd *osd;
+
+#ifdef HAVE_FREETYPE
+ char **availTTFs;
+ int nMaxTTFs;
+#endif
+
+#ifndef DISABLE_ANIMATED_TEXT
+ int yMessageTop;
+
+ struct tEffect {
+ int nAction;
+ uint nOffset;
+ int nDirection;
+ uint64_t nNextUpdate;
+ std::string strText;
+ int x, y, Width, Height;
+ tColor ColorFg, ColorBg;
+ const cFont *Font;
+ int Alignment;
+ cSkinEnigmaOsd *Skin;
+
+ public:
+ tEffect(void) : nAction(0), nOffset(0), nDirection(0),
+ nNextUpdate(0), x(0), y(0), Width(0), Height(0),
+ ColorFg(0), ColorBg(0), Font(NULL), Alignment(taDefault),
+ Skin(NULL)
+ {};
+ };
+
+ typedef std::vector<tEffect*> tEffects;
+ tEffects vecEffects;
+ cCondVar condSleep;
+ cMutex mutexSleep;
+ cMutex mutexRunning;
+
+ void DoEffect(tEffect *e, uint64_t nNow = 0);
+ void DoScroll(tEffect *e, uint64_t nNow, bool fDrawItem);
+ void DoBlink(tEffect *e, uint64_t nNow, bool fDrawItem);
+
+ void Wakeup(void)
+ {
+// printf("WAKE1: %p\n", pthread_self());
+ mutexSleep.Lock();
+ condSleep.Broadcast();
+ mutexSleep.Unlock();
+// printf("WAKE2: %p\n", pthread_self());
+ }
+#endif //DISABLE_ANIMATED_TEXT
+
+public:
+#ifdef DISABLE_ANIMATED_TEXT
+ cEnigmaTextEffects(void);
+ ~cEnigmaTextEffects(void);
+
+#else
+ cEnigmaTextEffects(const char *Description = NULL);
+ ~cEnigmaTextEffects(void);
+
+ virtual void Action(void);
+
+ bool Start(cOsd *o);
+ void Stop(void);
+ void Clear(void);
+
+ void ResetText(int i, tColor ColorFg = 0, tColor ColorBg = 0, bool fDraw = true);
+ void PauseEffects(int y = 0);
+ void UpdateTextWidth(int i, int Width);
+ int DrawAnimatedTitle(int o_id, int action, const char *s, const cFont *Font, int Width, cSkinEnigmaOsd *skin);
+ int DrawAnimatedText(int o_id, int action, int x, int y, const char *s, tColor ColorFg, tColor ColorBg, const cFont *Font, int Width = 0, int Height = 0, int Alignment = taDefault);
+
+ void UpdateLock(void)
+ {
+// printf("LOCK1: %p\n", pthread_self());
+ Lock();
+// printf("LOCK2: %p\n", pthread_self());
+ }
+
+ void UpdateUnlock(void)
+ {
+// printf("UNLOCK1: %p\n", pthread_self());
+ Unlock();
+// printf("UNLOCK2: %p\n", pthread_self());
+ }
+
+ void RefreshEffects(void)
+ { Wakeup(); }
+#endif //DISABLE_ANIMATED_TEXT
+
+#ifdef HAVE_FREETYPE
+ int GetNumAvailTTFs(void) { return nMaxTTFs; }
+ const char **GetAvailTTFs(void);
+#endif
+};
+
+extern cEnigmaTextEffects EnigmaTextEffects;
+
+#endif //__TEXTEFFECTS_H
+// vim:et:sw=2:ts=2: