diff options
author | Andreas Mair <amair.sob@googlemail.com> | 2007-06-25 12:44:11 +0200 |
---|---|---|
committer | Andreas Mair <amair.sob@googlemail.com> | 2007-06-25 12:44:11 +0200 |
commit | fc61e314442d22bb7886dba77380497b776fcb62 (patch) | |
tree | b6e891bb760438f2209d5f24ab489d8d01579026 | |
parent | ae9c6ccad6ba1ab419fe73d9e75f545cbbb62c96 (diff) | |
download | vdr-plugin-skinenigmang-fc61e314442d22bb7886dba77380497b776fcb62.tar.gz vdr-plugin-skinenigmang-fc61e314442d22bb7886dba77380497b776fcb62.tar.bz2 |
2007-06-25: Version 0.0.5rc3v0.0.5rc3
- Updated Finnish translation (Submitted by Rolf Ahrenberg).
- Added quickepgsearch, sport and music plugins in main menu logos (Submitted by zulu @vdr-portal.de).
- Reworked debug() and error().
- Use required width of date for calculation of logo area with.
- Don't let vector for text effects grow when moving through lists in menus.
- Added internal translation of long weeksdays (Requested and translated by Pat @vdr-portal.de).
- Support TrueTypeFonts again with VDR >=v1.5.4 (TTF width setup disabled).
- Read OSD size from VDR's cOsd as suggested in VDR and Avards plugin.
- Minor bugfixes and enhancements.
-rw-r--r-- | HISTORY | 11 | ||||
-rw-r--r-- | Makefile | 9 | ||||
-rw-r--r-- | common.h | 8 | ||||
-rw-r--r-- | config.c | 62 | ||||
-rw-r--r-- | config.h | 1 | ||||
-rw-r--r-- | enigma.c | 215 | ||||
-rw-r--r-- | font.c | 24 | ||||
-rw-r--r-- | font.h | 10 | ||||
-rw-r--r--[-rwxr-xr-x] | i18n.c | 186 | ||||
-rw-r--r-- | logo.c | 32 | ||||
-rw-r--r-- | setup.c | 12 | ||||
-rw-r--r-- | skinenigmang.c | 12 | ||||
-rw-r--r-- | status.c | 2 | ||||
-rw-r--r-- | texteffects.c | 52 | ||||
-rw-r--r-- | texteffects.h | 12 | ||||
-rw-r--r-- | tools.h | 10 |
16 files changed, 461 insertions, 197 deletions
@@ -1,6 +1,17 @@ VDR Skin 'EnigmaNG' Revision History ------------------------------------------ +2007-06-25: Version 0.0.5rc3 +- Updated Finnish translation (Submitted by Rolf Ahrenberg). +- Added quickepgsearch, sport and music plugins in main menu logos (Submitted by zulu @vdr-portal.de). +- Reworked debug() and error(). +- Use required width of date for calculation of logo area with. +- Don't let vector for text effects grow when moving through lists in menus. +- Added internal translation of long weeksdays (Requested and translated by Pat @vdr-portal.de). +- Support TrueTypeFonts again with VDR >=v1.5.4 (TTF width setup disabled). +- Read OSD size from VDR's cOsd as suggested in VDR and Avards plugin. +- Minor bugfixes and enhancements. + 2007-06-18: Version 0.0.5rc2 - Added Italian translation (Submitted by Gringo). - Changed logging to only report missing channel logos once. @@ -1,7 +1,7 @@ # # Makefile for a Video Disk Recorder plugin # -# $Id: Makefile,v 1.14 2007/06/11 06:57:47 amair Exp $ +# $Id: Makefile,v 1.16 2007/06/25 10:44:11 amair Exp $ # If you are using the epgsearch plugin and want to see the number of # timer conflicts in the main menu's info area. @@ -66,7 +66,8 @@ LIBDIR = ../../lib TMPDIR = /tmp ### Allow user defined options to overwrite defaults: - +#TODO +CLEAR_BUG_WORKAROUND = 1 -include $(VDRDIR)/Make.config ### The version number of VDR's plugin API (taken from VDR's "config.h"): @@ -113,6 +114,10 @@ ifdef SKINENIGMA_DISABLE_ANIMATED_TEXT DEFINES += -DDISABLE_ANIMATED_TEXT endif +ifdef CLEAR_BUG_WORKAROUND +DEFINES += -DCLEAR_BUG_WORKAROUND +endif + DEFINES += -DSKINENIGMA_FONTS=$(SKINENIGMA_FONTS) ### The object files (add further files here): @@ -13,16 +13,16 @@ #include <vdr/config.h> -// unset HAVE_FREETYPE if VDR version >=1.5.3 +// unset HAVE_FREETYPE if VDR 1.5.3 #ifdef HAVE_FREETYPE -# if VDRVERSNUM > 10502 +# if VDRVERSNUM == 10503 # undef HAVE_FREETYPE # endif #endif #ifdef DEBUG -#define debug(x...) printf("EnigmaNG: " x); -#define error(x...) printf("EnigmaNG: " x); +#define debug(x...) { printf("EnigmaNG: " x); printf("\n"); } +#define error(x...) { fprintf(stderr, "EnigmaNG: " x); fprintf(stderr, "\n"); } #else #define debug(x...) ; #define error(x...) esyslog("EnigmaNG: " x); @@ -24,7 +24,9 @@ const char *imageExtensionTexts[NUM_IMAGEEXTENSIONTEXTS] = { "xpm", "jpg", "png" cEnigmaConfig EnigmaConfig; #ifdef HAVE_FREETYPE +# if VDRVERSNUM != 10503 cGraphtftFont FontCache; +# endif #endif FontConfig allFontConfig[FONT_NUMFONTS] = @@ -73,12 +75,15 @@ cEnigmaConfig::cEnigmaConfig() : showAuxInfo(1), showLogo(1), showVps(1), showSy case FONT_CILANGUAGE: case FONT_DETAILSSUBTITLE: allFonts[id].VdrId = fontSml + 1; + allFonts[id].Default = fontSml; break; case FONT_FIXED: allFonts[id].VdrId = fontFix + 1; + allFonts[id].Default = fontFix; break; default: allFonts[id].VdrId = fontOsd + 1; + allFonts[id].Default = fontOsd; } memset(allFonts[id].Name, 0, sizeof(allFonts[id].Name)); allFonts[id].Width = 100; @@ -93,7 +98,7 @@ cEnigmaConfig::~cEnigmaConfig() void cEnigmaConfig::SetLogoDir(const char *logodirP) { if (logodirP) { - debug("cEnigmaConfig::SetLogoDir(%s)\n", logodirP); + debug("cEnigmaConfig::SetLogoDir(%s)", logodirP); strncpy(logoDir, logodirP, sizeof(logoDir)); } } @@ -101,7 +106,7 @@ void cEnigmaConfig::SetLogoDir(const char *logodirP) void cEnigmaConfig::SetImagesDir(const char *dir) { if (dir) { - debug("cEnigmaConfig::SetImagesDir(%s)\n", dir); + debug("cEnigmaConfig::SetImagesDir(%s)", dir); strncpy(strImagesDir, dir, sizeof(strImagesDir)); } } @@ -119,7 +124,7 @@ const char *cEnigmaConfig::GetImageExtension(void) void cEnigmaConfig::SetFontsDir(const char *dir) { if (dir) { - debug("cEnigmaConfig::SetFontsDir(%s)\n", dir); + debug("cEnigmaConfig::SetFontsDir(%s)", dir); strncpy(strFontsDir, dir, sizeof(strFontsDir)); } } @@ -128,24 +133,32 @@ void cEnigmaConfig::SetFontsDir(const char *dir) const cFont *cEnigmaConfig::GetFont(int id) { const cFont *res = NULL; - if (allFonts[id].VdrId == FONT_TRUETYPE) { + if (::Setup.UseSmallFont == 1) { // if "Use small font" == "skin dependent" + if (allFonts[id].VdrId == FONT_TRUETYPE) { + if (!isempty(allFonts[id].Name)) { #ifdef HAVE_FREETYPE - char *cachename; - asprintf(&cachename, "%s_%d_%d_%d", allFonts[id].Name, allFonts[id].Size, allFonts[id].Width, Setup.OSDLanguage); - if (FontCache.Load(string(strFontsDir) + "/" + string(allFonts[id].Name), cachename, allFonts[id].Size, Setup.OSDLanguage, allFonts[id].Width)) { - res = FontCache.GetFont(cachename); - } else { - error("ERROR: EnigmaNG: Couldn't load font %s:%d", allFonts[id].Name, allFonts[id].Size); - } - free(cachename); + char *cachename; + asprintf(&cachename, "%s_%d_%d_%d", allFonts[id].Name, allFonts[id].Size, allFonts[id].Width, Setup.OSDLanguage); + if (FontCache.Load(string(strFontsDir) + "/" + string(allFonts[id].Name), cachename, allFonts[id].Size, Setup.OSDLanguage, allFonts[id].Width)) { + res = FontCache.GetFont(cachename); + } else { + error("ERROR: EnigmaNG: Couldn't load font %s:%d", allFonts[id].Name, allFonts[id].Size); + } + free(cachename); #else - error("ERROR: EnigmaNG: Font engine not enabled at compile time!"); + error("ERROR: EnigmaNG: Font engine not enabled at compile time!"); #endif - } else if (allFonts[id].VdrId > FONT_TRUETYPE) { - res = cFont::GetFont((eDvbFont)(allFonts[id].VdrId - 1)); - } else { - res = cFont::GetFont((eDvbFont)allFonts[id].VdrId); + } + } else if (allFonts[id].VdrId > FONT_TRUETYPE) { + res = cFont::GetFont((eDvbFont)(allFonts[id].VdrId - 1)); + } else { + res = cFont::GetFont((eDvbFont)allFonts[id].VdrId); + } } + + if (res == NULL) + res = cFont::GetFont((eDvbFont)allFonts[id].Default); + if (res) return res; else @@ -157,7 +170,7 @@ void cEnigmaConfig::SetFont(int id, const char *font) if (id >= 0 && id < FONT_NUMFONTS && font) { char *tmp = strrchr(font, ':'); if (tmp) { - strncpy(allFonts[id].Name, font, min((int)sizeof(allFonts[id].Name), tmp - font)); + strncpy(allFonts[id].Name, font, std::min((int)sizeof(allFonts[id].Name), tmp - font)); allFonts[id].Size = atoi(tmp + 1); tmp = strchr(tmp + 1, ','); if (tmp) { @@ -186,7 +199,15 @@ void cEnigmaConfig::GetOsdSize(struct EnigmaOsdSize *size) size->w = Setup.OSDWidth; size->h = Setup.OSDHeight; -#ifdef USE_PLUGIN_AVARDS +#if VDRVERSNUM >= 10504 + if (dynOsd) { + size->y = cOsd::OsdTop(); + size->x = cOsd::OsdLeft(); + size->w = cOsd::OsdWidth(); + size->h = cOsd::OsdHeight(); + } +#else +# ifdef USE_PLUGIN_AVARDS if (dynOsd) { cPlugin *p = cPluginManager::GetPlugin("avards"); if (p) { @@ -199,6 +220,7 @@ void cEnigmaConfig::GetOsdSize(struct EnigmaOsdSize *size) } } } -#endif +# endif +#endif //VDRVERSNUM >= 10504 } // vim:et:sw=2:ts=2: @@ -70,6 +70,7 @@ struct FontInfo char Name[MAXFONTNAME + 1]; int Width; int Size; + int Default; }; struct FontConfig @@ -65,6 +65,8 @@ #include "symbols/small/mail.xpm" #endif +static const char *strWeekdays[] = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"}; + static cBitmap bmEventPartTimer(eventparttimer_xpm); static cBitmap bmEventTimer(eventtimer_xpm); static cBitmap bmEventVPS(eventvps_xpm); @@ -259,7 +261,7 @@ public: cSkinEnigmaDisplayChannel::cSkinEnigmaDisplayChannel(bool WithInfo) { - debug("cSkinEnigmaDisplayChannel::cSkinEnigmaDisplayChannel(%d)\n", WithInfo); + debug("cSkinEnigmaDisplayChannel::cSkinEnigmaDisplayChannel(%d)", WithInfo); struct EnigmaOsdSize OsdSize; EnigmaConfig.GetOsdSize(&OsdSize); @@ -280,7 +282,7 @@ cSkinEnigmaDisplayChannel::cSkinEnigmaDisplayChannel(bool WithInfo) #endif int MessageHeight = 2 * SmallGap + pFontMessage->Height() + 2 * SmallGap; - int LogoSize = max(pFontTitle->Height() * 2 + pFontSubtitle->Height() * 2 + SmallGap, ChannelLogoHeight); + int LogoSize = std::max(pFontTitle->Height() * 2 + pFontSubtitle->Height() * 2 + SmallGap, ChannelLogoHeight); LogoSize += (LogoSize % 2 ? 1 : 0); // title bar & logo area xLogoLeft = 0; @@ -290,7 +292,7 @@ cSkinEnigmaDisplayChannel::cSkinEnigmaDisplayChannel(bool WithInfo) xTitleLeft = (fShowLogo && !EnigmaConfig.fullTitleWidth ? xLogoDecoRight + LogoDecoGap2 : xLogoLeft); xTitleRight = xTitleLeft + ((OsdSize.w - xTitleLeft) & ~0x07); // width must be multiple of 8 yTitleTop = 0; - yTitleBottom = yTitleTop + max(pFontOsdTitle->Height(), pFontDate->Height()); + yTitleBottom = yTitleTop + std::max(pFontOsdTitle->Height(), pFontDate->Height()); yTitleDecoTop = yTitleBottom + TitleDecoGap; yTitleDecoBottom = yTitleDecoTop + TitleDecoHeight; yLogoTop = yTitleDecoBottom + TitleDecoGap2; @@ -326,12 +328,12 @@ cSkinEnigmaDisplayChannel::cSkinEnigmaDisplayChannel(bool WithInfo) osd = cOsdProvider::NewOsd(OsdSize.x, OsdSize.y + (Setup.ChannelInfoPos ? 0 : (OsdSize.h - yBottomBottom)) ); tArea Areas[] = { {0, 0, xBottomRight - 1, yBottomBottom - 1, fShowLogo || EnigmaConfig.showFlags ? 8 : 4} }; if ((Areas[0].bpp < 8 || EnigmaConfig.singleArea8Bpp) && osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk) { - debug("cSkinEnigmaDisplayChannel: using %dbpp single area\n", Areas[0].bpp); + debug("cSkinEnigmaDisplayChannel: using %dbpp single area", Areas[0].bpp); osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea)); // clear all osd->DrawRectangle(0, 0, osd->Width(), osd->Height(), clrTransparent); } else { - debug("cSkinEnigmaDisplayChannel: using multiple areas\n"); + debug("cSkinEnigmaDisplayChannel: using multiple areas"); if (fShowLogo) { tArea Areas[] = { {xLogoLeft, yLogoTop, xLogoDecoRight - 1, yLogoBottom - 1, 4}, {xTitleLeft, yTitleTop, xTitleRight - 1, yTitleDecoBottom - 1, 2}, @@ -342,7 +344,7 @@ cSkinEnigmaDisplayChannel::cSkinEnigmaDisplayChannel(bool WithInfo) if (rc == oeOk) osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea)); else { - error("cSkinEnigmaDisplayChannel: CanHandleAreas() returned %d\n", rc); + error("cSkinEnigmaDisplayChannel: CanHandleAreas() returned %d", rc); delete osd; osd = NULL; throw 1; @@ -357,7 +359,7 @@ cSkinEnigmaDisplayChannel::cSkinEnigmaDisplayChannel(bool WithInfo) if (rc == oeOk) osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea)); else { - error("cSkinEnigmaDisplayChannel: CanHandleAreas() returned %d\n", rc); + error("cSkinEnigmaDisplayChannel: CanHandleAreas() returned %d", rc); delete osd; osd = NULL; throw 1; @@ -377,7 +379,7 @@ cSkinEnigmaDisplayChannel::cSkinEnigmaDisplayChannel(bool WithInfo) cSkinEnigmaDisplayChannel::~cSkinEnigmaDisplayChannel() { - debug("cSkinEnigmaDisplayChannel::~cSkinEnigmaDisplayChannel()\n"); + debug("cSkinEnigmaDisplayChannel::~cSkinEnigmaDisplayChannel()"); #ifndef DISABLE_ANIMATED_TEXT if (fScrollTitle) { @@ -635,7 +637,7 @@ cString cSkinEnigmaDisplayChannel::GetChannelNumber(const cChannel *Channel, int void cSkinEnigmaDisplayChannel::SetChannel(const cChannel *Channel, int Number) { - debug("cSkinEnigmaDisplayChannel::SetChannel()\n"); + debug("cSkinEnigmaDisplayChannel::SetChannel()"); #ifndef DISABLE_ANIMATED_TEXT if (fScrollTitle && !fLocked) @@ -678,7 +680,7 @@ void cSkinEnigmaDisplayChannel::SetChannel(const cChannel *Channel, int Number) void cSkinEnigmaDisplayChannel::SetEvents(const cEvent *Present, const cEvent *Following) { - debug("cSkinEnigmaDisplayChannel::SetEvents() %d %d\n", fScrollTitle, fLocked); + debug("cSkinEnigmaDisplayChannel::SetEvents() %d %d", fScrollTitle, fLocked); int xTimeLeft = xEventNowLeft + Gap; int xTimeWidth = pFontTitle->Width("00:00"); @@ -715,7 +717,7 @@ void cSkinEnigmaDisplayChannel::SetEvents(const cEvent *Present, } } - int xDurationLeft = xEventNowRight - Gap - max(pFontTitle->Width(sLen), pFontSubtitle->Width(sNow)); + int xDurationLeft = xEventNowRight - Gap - std::max(pFontTitle->Width(sLen), pFontSubtitle->Width(sNow)); int xDurationWidth = xEventNowRight - Gap - xDurationLeft; int xTextLeft = xTimeLeft + xTimeWidth + BigGap; int xTextWidth = xDurationLeft - xTextLeft - BigGap; @@ -760,7 +762,7 @@ void cSkinEnigmaDisplayChannel::SetEvents(const cEvent *Present, int xBarLeft = xBottomLeft + Roundness; int xBarWidth = (xFirstSymbol > xBarLeft ? (xFirstSymbol - Gap - xBarLeft) : 124); int x = xBarLeft + SmallGap + (int)(ceil((float)(now) / (float)(total) * (float)(xBarWidth - Gap - SmallGap))); - x = min(x, xBarLeft + Gap + xBarWidth - SmallGap - 1); + x = std::min(x, xBarLeft + Gap + xBarWidth - SmallGap - 1); osd->DrawRectangle(xBarLeft, yBottomTop + SmallGap + SmallGap, xBarLeft + Gap + xBarWidth - 1, yBottomBottom - SmallGap - SmallGap - 1, @@ -811,7 +813,7 @@ void cSkinEnigmaDisplayChannel::SetEvents(const cEvent *Present, void cSkinEnigmaDisplayChannel::SetMessage(eMessageType Type, const char *Text) { - debug("cSkinEnigmaDisplayChannel::SetMessage()\n"); + debug("cSkinEnigmaDisplayChannel::SetMessage()"); #ifndef DISABLE_ANIMATED_TEXT if (fScrollTitle && !fLocked) @@ -848,7 +850,7 @@ void cSkinEnigmaDisplayChannel::SetMessage(eMessageType Type, const char *Text) void cSkinEnigmaDisplayChannel::Flush(void) { -// debug("cSkinEnigmaDisplayChannel::Flush()\n"); +// debug("cSkinEnigmaDisplayChannel::Flush()"); #ifndef DISABLE_ANIMATED_TEXT if (!fLocked && fScrollTitle) @@ -941,6 +943,7 @@ private: const char *GetPluginMainMenuName(const char *plugin); int ReadSizeVdr(const char *strPath); bool HasTabbedText(const char *s, int Tab); + int getDateWidth(void); public: cSkinEnigmaDisplayMenu(); @@ -1008,20 +1011,29 @@ cSkinEnigmaDisplayMenu::cSkinEnigmaDisplayMenu(void) fScrollOther = EnigmaConfig.useTextEffects && EnigmaConfig.scrollOther; #endif - int LogoHeight = max(max(pFontOsdTitle->Height(), pFontDate->Height()) + TitleDeco + pFontDetailsTitle->Height() + Gap + pFontDetailsSubtitle->Height(), - max(3 * pFontDate->Height(), - (EnigmaConfig.showImages ? max(EnigmaConfig.imageHeight, IconHeight) : IconHeight) - ) - ); - int LogoWidth = EnigmaConfig.showImages ? max(IconWidth, EnigmaConfig.imageWidth) : IconWidth; - int RightColWidth = (144 + LogoWidth) & ~0x07; // must be multiple of 8 + int LogoHeight = std::max(std::max(pFontOsdTitle->Height(), pFontDate->Height()) + TitleDeco + pFontDetailsTitle->Height() + Gap + pFontDetailsSubtitle->Height(), + std::max(3 * pFontDate->Height(), + (EnigmaConfig.showImages ? std::max(EnigmaConfig.imageHeight, IconHeight) : IconHeight) + ) + ); + int LogoWidth = EnigmaConfig.showImages ? std::max(IconWidth, EnigmaConfig.imageWidth) : IconWidth; + int RightColWidth = 0; + if (fShowLogoDefault) { + int nMainDateWidth = getDateWidth() + SmallGap + LogoWidth; + cString date = DayDateTime(); + int nSubDateWidth = pFontDate->Width(date); + RightColWidth = (SmallGap + Gap + std::max(nMainDateWidth, nSubDateWidth) + Gap) & ~0x07; // must be multiple of 8 + } else { + cString date = DayDateTime(); + RightColWidth = (SmallGap + Gap + pFontDate->Width(date) + Gap) & ~0x07; // must be multiple of 8 + } int MessageHeight = 2 * SmallGap + pFontMessage->Height() + 2 * SmallGap; // title bar xTitleLeft = 0; xTitleRight = OsdSize.w - RightColWidth; yTitleTop = 0; - yTitleBottom = max(pFontOsdTitle->Height(), pFontDate->Height()); + yTitleBottom = std::max(pFontOsdTitle->Height(), pFontDate->Height()); yTitleDecoTop = yTitleBottom + TitleDecoGap; yTitleDecoBottom = yTitleDecoTop + TitleDecoHeight; // help buttons @@ -1060,15 +1072,15 @@ cSkinEnigmaDisplayMenu::cSkinEnigmaDisplayMenu(void) tArea Areas[] = { {xTitleLeft, yTitleTop, xMessageRight - 1, yButtonsBottom - 1, 8} }; if (EnigmaConfig.singleArea8Bpp && osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk) { - debug("cSkinEnigmaDisplayMenu: using %dbpp single area\n", Areas[0].bpp); + debug("cSkinEnigmaDisplayMenu: using %dbpp single area", Areas[0].bpp); osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea)); nNumImageColors = 230; //TODO: find correct number of colors } else { - debug("cSkinEnigmaDisplayMenu: using multiple areas\n"); + debug("cSkinEnigmaDisplayMenu: using multiple areas"); tArea Areas[] = { {xTitleLeft, yTitleTop, xTitleRight - 1, yTitleDecoBottom - 1, 2}, //title area {xBodyLeft, yBodyTop, xBodyRight - 1, yInfoTop + pFontDetailsDate->Height() - 1, 2}, //body area (beside date/logo/symbols area) {xDateLeft, yDateTop, xLogoRight - 1, yInfoTop - 1, 4}, //date/logo area - {xBodyRight, yInfoTop, xInfoRight - 1, yInfoTop + pFontDetailsDate->Height() - 1, 4}, //area for symbols in event/recording info + {xInfoLeft, yInfoTop, xInfoRight - 1, yInfoTop + pFontDetailsDate->Height() - 1, 4}, //area for symbols in event/recording info {xBodyLeft, yInfoTop + pFontDetailsDate->Height(), xInfoRight - 1, yMessageTop - 1, 2}, // body/info area (below symbols area) {xMessageLeft, yMessageTop, xButtonsRight - 1, yButtonsBottom - 1, 4} //buttons/message area }; @@ -1077,7 +1089,7 @@ cSkinEnigmaDisplayMenu::cSkinEnigmaDisplayMenu(void) if (rc == oeOk) osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea)); else { - error("cSkinEnigmaDisplayMenu: CanHandleAreas() [1] returned %d\n", rc); + error("cSkinEnigmaDisplayMenu: CanHandleAreas() [1] returned %d", rc); delete osd; osd = NULL; throw 1; @@ -1104,7 +1116,7 @@ cSkinEnigmaDisplayMenu::cSkinEnigmaDisplayMenu(void) void cSkinEnigmaDisplayMenu::SetColors(void) { - debug("cSkinEnigmaDisplayMenu::SetColors\n"); + debug("cSkinEnigmaDisplayMenu::SetColors()"); if (osd->GetBitmap(1) == NULL) { //single area cBitmap *bitmap = osd->GetBitmap(0); @@ -1206,7 +1218,7 @@ void cSkinEnigmaDisplayMenu::SetupAreas(void) { //Must be TE_LOCKed by caller - debug("cSkinEnigmaDisplayMenu::SetupAreas\n"); + debug("cSkinEnigmaDisplayMenu::SetupAreas() %d %d %d", isMainMenu, fShowLogo, fShowInfo); fSetupAreasDone = true; SetColors(); @@ -1236,12 +1248,12 @@ void cSkinEnigmaDisplayMenu::SetupAreas(void) osd->DrawRectangle(xDateLeft + SmallGap, yDateTop, xLogoRight - 1, yDateBottom - SmallGap - 1, Theme.Color(clrLogoBg)); //draw borders osd->DrawRectangle(xDateLeft, yDateTop, xDateLeft + SmallGap - 1, yLogoBottom - SmallGap - 1, clrTransparent); - osd->DrawRectangle(xDateLeft, yLogoBottom - SmallGap, xDateRight, yLogoBottom - 1, clrTransparent); + osd->DrawRectangle(xDateLeft, yLogoBottom - SmallGap, xInfoRight - 1, yLogoBottom - 1, clrTransparent); } else { osd->DrawRectangle(xDateLeft + SmallGap, yDateTop, xLogoRight - 1, yTitleDecoBottom - 1, Theme.Color(clrLogoBg)); //draw borders osd->DrawRectangle(xDateLeft, yDateTop, xDateLeft + SmallGap - 1, yTitleDecoBottom - 1, clrTransparent); - osd->DrawRectangle(xDateLeft, yTitleDecoBottom, xInfoRight, yBodyTop - 1, clrTransparent); + osd->DrawRectangle(xDateLeft, yTitleDecoBottom, xInfoRight - 1, yBodyTop - 1, clrTransparent); } // draw body area @@ -1249,11 +1261,18 @@ void cSkinEnigmaDisplayMenu::SetupAreas(void) // draw info area if (fShowInfo) { +#ifdef CLEAR_BUG_WORKAROUND + osd->DrawRectangle(xInfoLeft, fShowLogo ? yInfoTop : yBodyTop, xInfoRight - 2, yInfoBottom - 1, Theme.Color(clrAltBackground)); +#else osd->DrawRectangle(xInfoLeft, fShowLogo ? yInfoTop : yBodyTop, xInfoRight - 1, yInfoBottom - 1, Theme.Color(clrAltBackground)); +#endif int x = xInfoLeft + Gap; int y = fShowLogo ? yInfoTop : yBodyTop; int w = xInfoRight - x; +#ifdef CLEAR_BUG_WORKAROUND + w--; +#endif int yMaxHeight = yInfoBottom; #ifdef SKINENIGMA_HAVE_EPGSEARCH @@ -1340,6 +1359,9 @@ void cSkinEnigmaDisplayMenu::SetupAreas(void) } } +#ifdef CLEAR_BUG_WORKAROUND + osd->DrawRectangle(xInfoRight - 1, (fShowLogo ? yInfoTop : yBodyTop) - SmallGap, xInfoRight - 1, yInfoBottom - 1, Theme.Color(clrMenuItemNotSelectableFg)); +#endif } else { // !fShowInfo osd->DrawRectangle(xInfoLeft, fShowLogo ? yInfoTop : yBodyTop, xInfoRight - 1, yInfoBottom - 1, Theme.Color(clrBackground)); } @@ -1409,12 +1431,12 @@ int cSkinEnigmaDisplayMenu::MaxItems(void) void cSkinEnigmaDisplayMenu::Clear(void) { - debug("cSkinEnigmaDisplayMenu::Clear\n"); + debug("cSkinEnigmaDisplayMenu::Clear() %d %d %d", isMainMenu, fShowLogo, fShowInfo); #ifndef DISABLE_ANIMATED_TEXT if (!fLocked) TE_LOCK; nOldIndex = -1; - for (int i = 0; i < MaxTabs; i++) { + for (int i = MaxTabs - 1; i >= 0; i--) { if (idListItem[i] >= 0) { EnigmaTextEffects.ResetText(idListItem[i], Theme.Color(clrMenuItemSelectableFg), Theme.Color(clrBackground), !fLocked); idListItem[i] = -1; @@ -1435,7 +1457,7 @@ void cSkinEnigmaDisplayMenu::Clear(void) osd->DrawRectangle(xBodyLeft, yBodyTop, xBodyRight - 1, yBodyBottom - 1, Theme.Color(clrBackground)); //TODO? clear logo and/or info area? } else { - osd->DrawRectangle(xBodyLeft, yBodyTop, xInfoRight - 1, yBodyBottom - 1, Theme.Color(clrBackground)); + osd->DrawRectangle(xBodyLeft, yBodyTop, xInfoRight - 1, yInfoBottom - 1, Theme.Color(clrBackground)); } } #ifndef DISABLE_ANIMATED_TEXT @@ -1446,7 +1468,7 @@ void cSkinEnigmaDisplayMenu::Clear(void) void cSkinEnigmaDisplayMenu::SetTitle(const char *Title) { - debug("cSkinEnigmaDisplayMenu::SetTitle(%s)\n", Title); + debug("cSkinEnigmaDisplayMenu::SetTitle(%s)", Title); bool fTitleChanged = false; if (Title && strTitle) { @@ -1546,7 +1568,6 @@ void cSkinEnigmaDisplayMenu::DrawTitle(const char *Title) // draw rounded left corner of title bar osd->DrawEllipse(xTitleLeft, yTitleTop, xTitleLeft + Roundness - 1, yTitleTop + Roundness - 1, clrTransparent, -2); -// debug("DrawTitle(%s)\n", Title); if (Title) { int y = yTitleTop + (yTitleBottom - yTitleTop - pFontOsdTitle->Height()) / 2; // draw title with shadow @@ -1565,7 +1586,7 @@ void cSkinEnigmaDisplayMenu::DrawTitle(const char *Title) void cSkinEnigmaDisplayMenu::SetButtons(const char *Red, const char *Green, const char *Yellow, const char *Blue) { - debug("cSkinEnigmaDisplayMenu::SetButtons(%s, %s, %s, %s)\n", Red, Green, Yellow, Blue); + debug("cSkinEnigmaDisplayMenu::SetButtons(%s, %s, %s, %s)", Red, Green, Yellow, Blue); #ifndef DISABLE_ANIMATED_TEXT if (!fLocked) TE_LOCK; @@ -1670,6 +1691,8 @@ bool cSkinEnigmaDisplayMenu::HasTabbedText(const char *s, int Tab) void cSkinEnigmaDisplayMenu::SetItem(const char *Text, int Index, bool Current, bool Selectable) { + debug("cSkinEnigmaDisplayMenu::SetItem(%s, %d, %d, %d)", Text, Index, Current, Selectable); + int y = yItemTop + Index * lineHeight; if (nMessagesShown > 0 && y >= yMessageTop) return; //Don't draw above messages @@ -1694,7 +1717,7 @@ void cSkinEnigmaDisplayMenu::SetItem(const char *Text, int Index, bool Current, #ifndef DISABLE_ANIMATED_TEXT if (!Current && Index == nOldIndex) { - for (int i = 0; i < MaxTabs; i++) { + for (int i = MaxTabs - 1; i >= 0; i--) { if (idListItem[i] >= 0) { EnigmaTextEffects.ResetText(idListItem[i], ColorFg, ColorBg); idListItem[i] = -1; @@ -1820,7 +1843,7 @@ void cSkinEnigmaDisplayMenu::SetItem(const char *Text, int Index, bool Current, // define x coordinates of progressbar int px0 = xt; int px1 = (Selectable ? (Tab(i + 1) ? Tab(i + 1) : xItemRight) : xItemRight) - 1; - int px = px0 + max((int)((float) now * (float) (px1 - px0) / (float) total), ListProgressBarBorder); + int px = px0 + std::max((int)((float) now * (float) (px1 - px0) / (float) total), ListProgressBarBorder); // define y coordinates of progressbar int py0 = y + ListProgressBarGap; int py1 = y + lineHeight - ListProgressBarGap; @@ -1840,12 +1863,12 @@ void cSkinEnigmaDisplayMenu::SetItem(const char *Text, int Index, bool Current, if (fScrollListItem) { // if (i > 0) //TODO? EnigmaTextEffects.UpdateTextWidth(idListItem[i - 1], Tab(i) - Tab(i - 1)); - idListItem[i] = TE_MARQUEE(osd, idListItem[i], xt, y, s, ColorFg, ColorBg, pFontList, w, nMessagesShown ? min(yMessageTop - y, lineHeight) : 0 ); + idListItem[i] = TE_MARQUEE(osd, idListItem[i], xt, y, s, ColorFg, ColorBg, pFontList, w, nMessagesShown ? std::min(yMessageTop - y, lineHeight) : 0 ); } else #endif - osd->DrawText(xt, y, s, ColorFg, ColorBg, pFontList, w, nMessagesShown ? min(yMessageTop - y, lineHeight) : 0 ); + osd->DrawText(xt, y, s, ColorFg, ColorBg, pFontList, w, nMessagesShown ? std::min(yMessageTop - y, lineHeight) : 0 ); } else - osd->DrawText(xt, y, s, ColorFg, ColorBg, pFontList, w, nMessagesShown ? min(yMessageTop - y, lineHeight) : 0 ); + osd->DrawText(xt, y, s, ColorFg, ColorBg, pFontList, w, nMessagesShown ? std::min(yMessageTop - y, lineHeight) : 0 ); } } if (!Tab(i + 1)) @@ -1855,7 +1878,6 @@ void cSkinEnigmaDisplayMenu::SetItem(const char *Text, int Index, bool Current, SetEditableWidth(xItemRight - Tab(1) - xItemLeft); #ifndef SKINENIGMA_NO_MENULOGO -// debug("SetItem: (%s) %d %d %d\n", Text, Index, Current, Selectable); if (Current && isMainMenu && fShowLogo && Text) { char *ItemText, *ItemText2; int n = strtoul(Text, &ItemText, 10); @@ -1864,7 +1886,6 @@ void cSkinEnigmaDisplayMenu::SetItem(const char *Text, int Index, bool Current, else ItemText2 = skipspace(ItemText); - //debug("SetItem: %d (%s) %d %d %d\n", n, ItemText, Index, Current, Selectable); bool fFoundLogo = false; if (strcmp(ItemText, tr("Schedule")) == 0) fFoundLogo = EnigmaLogoCache.LoadIcon("icons/menu/schedule"); @@ -1912,7 +1933,8 @@ void cSkinEnigmaDisplayMenu::SetItem(const char *Text, int Index, bool Current, else if (strcmp(ItemText2, GetPluginMainMenuName("epgsearch")) == 0 || strcmp(ItemText2, GetPluginMainMenuName("epgsearchonly")) == 0 || strcmp(ItemText2, GetPluginMainMenuName("conflictcheckonly")) == 0 - || strcmp(ItemText2, GetPluginMainMenuName("nordlichtsepg")) == 0) + || strcmp(ItemText2, GetPluginMainMenuName("nordlichtsepg")) == 0 + || strcmp(ItemText2, GetPluginMainMenuName("quickepgsearch")) == 0) fFoundLogo = EnigmaLogoCache.LoadIcon("icons/menu/epgsearch"); else if (strcmp(ItemText2, GetPluginMainMenuName("externalplayer")) == 0) fFoundLogo = EnigmaLogoCache.LoadIcon("icons/menu/externalplayer"); @@ -1920,7 +1942,8 @@ void cSkinEnigmaDisplayMenu::SetItem(const char *Text, int Index, bool Current, fFoundLogo = EnigmaLogoCache.LoadIcon("icons/menu/femon"); else if (strcmp(ItemText2, GetPluginMainMenuName("filebrowser")) == 0) fFoundLogo = EnigmaLogoCache.LoadIcon("icons/menu/filebrowser"); - else if (strcmp(ItemText2, GetPluginMainMenuName("fussball")) == 0) + else if (strcmp(ItemText2, GetPluginMainMenuName("fussball")) == 0 + || strcmp(ItemText2, GetPluginMainMenuName("sport")) == 0) fFoundLogo = EnigmaLogoCache.LoadIcon("icons/menu/fussball"); else if (strcmp(ItemText2, GetPluginMainMenuName("games")) == 0) fFoundLogo = EnigmaLogoCache.LoadIcon("icons/menu/games"); @@ -1929,7 +1952,8 @@ void cSkinEnigmaDisplayMenu::SetItem(const char *Text, int Index, bool Current, fFoundLogo = EnigmaLogoCache.LoadIcon("icons/menu/image"); else if (strcmp(ItemText2, GetPluginMainMenuName("mp3")) == 0 || strcmp(ItemText2, GetPluginMainMenuName("mp3ng")) == 0 - || strcmp(ItemText2, GetPluginMainMenuName("muggle")) == 0) + || strcmp(ItemText2, GetPluginMainMenuName("muggle")) == 0 + || strcmp(ItemText2, GetPluginMainMenuName("music")) == 0) fFoundLogo = EnigmaLogoCache.LoadIcon("icons/menu/mp3"); else if (strcmp(ItemText2, GetPluginMainMenuName("mplayer")) == 0) fFoundLogo = EnigmaLogoCache.LoadIcon("icons/menu/mplayer"); @@ -2464,12 +2488,33 @@ const cFont *cSkinEnigmaDisplayMenu::GetTextAreaFont(bool FixedFont) const return FixedFont ? pFontFixed : pFontDetailsText; } +int cSkinEnigmaDisplayMenu::getDateWidth(void) +{ + int w = 144; + struct tm tm_r; + time_t t = time(NULL); + tm *tm = localtime_r(&t, &tm_r); + + int nWeekday = tm->tm_wday; + if (0 <= nWeekday && nWeekday < 7) + w = pFontDate->Width(strWeekdays[nWeekday]); + + char temp[32]; + strftime(temp, sizeof(temp), "%d.%m.%Y", tm); + w = std::max(w, pFontDate->Width(temp)); + + cString time = TimeString(t); + w = std::max(w, pFontDate->Width(time)); + + return w; +} + void cSkinEnigmaDisplayMenu::Flush(void) { #ifndef DISABLE_ANIMATED_TEXT if (!fLocked) TE_LOCK; #endif -//debug("cSkinEnigmaDisplayMenu::Flush\n"); +debug("cSkinEnigmaDisplayMenu::Flush()"); if (fShowLogo) { time_t t = time(NULL); @@ -2480,16 +2525,24 @@ void cSkinEnigmaDisplayMenu::Flush(void) int x = xDateLeft + SmallGap; int w = xLogoLeft - x; - int ys = yDateTop + (yDateBottom - yDateTop - 3 * pFontDate->Height()) / 2; + int ys = yDateTop + (yDateBottom - SmallGap - yDateTop - 3 * pFontDate->Height()) / 2; char temp[32]; struct tm tm_r; tm *tm = localtime_r(&t, &tm_r); + int nWeekday = tm->tm_wday; + if (0 <= nWeekday && nWeekday < 7) { + osd->DrawText(x, ys, tr(strWeekdays[nWeekday]), Theme.Color(clrMenuTxtFg), + Theme.Color(clrLogoBg), pFontDate, w, + pFontDate->Height(), taCenter); + } + /*TODO: old strftime(temp, sizeof(temp), "%A", tm); osd->DrawText(x, ys, temp, Theme.Color(clrMenuTxtFg), Theme.Color(clrLogoBg), pFontDate, w, pFontDate->Height(), taCenter); + */ ys += pFontDate->Height(); strftime(temp, sizeof(temp), "%d.%m.%Y", tm); @@ -2621,10 +2674,10 @@ cSkinEnigmaDisplayReplay::cSkinEnigmaDisplayReplay(bool ModeOnly) osd = cOsdProvider::NewOsd(OsdSize.x, OsdSize.y + OsdSize.h - yBottomBottom); tArea Areas[] = { {xTitleLeft, yTitleTop, xBottomRight - 1, yBottomBottom - 1, fShowSymbol ? 8 : 4} }; if ((Areas[0].bpp < 8 || EnigmaConfig.singleArea8Bpp) && osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk) { - debug("cSkinEnigmaDisplayReplay: using %dbpp single area\n", Areas[0].bpp); + debug("cSkinEnigmaDisplayReplay: using %dbpp single area", Areas[0].bpp); osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea)); } else { - debug("cSkinEnigmaDisplayReplay: using multiple areas\n"); + debug("cSkinEnigmaDisplayReplay: using multiple areas"); tArea Areas[] = { {xTitleLeft, yTitleTop, xTitleRight - 1, yTitleDecoBottom - 1, 2}, {xLogoLeft, yLogoTop, xLogoRight + 1, yLogoBottom - 1, 4}, //TODO? "+1" because of wrong colors with "-1" {xProgressLeft, yProgressTop, xTimeRight - 1, yTimeBottom - 1, 4}, @@ -2634,7 +2687,7 @@ cSkinEnigmaDisplayReplay::cSkinEnigmaDisplayReplay(bool ModeOnly) if (rc == oeOk) osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea)); else { - error("cSkinEnigmaDisplayReplay: CanHandleAreas() returned %d\n", rc); + error("cSkinEnigmaDisplayReplay: CanHandleAreas() returned %d", rc); delete osd; osd = NULL; throw 1; @@ -2723,7 +2776,7 @@ void cSkinEnigmaDisplayReplay::DrawTitle(const char *Title) yTitleDecoBottom - 1, Theme.Color(clrTitleBg)); if (Title) { - debug("REPLAY TITLE: %s\n", Title); + debug("REPLAY TITLE: %s", Title); // draw titlebar osd->DrawText(xTitleLeft + Roundness + 3, yTitleTop + 3, Title, Theme.Color(clrTitleShadow), clrTransparent, @@ -2771,13 +2824,13 @@ void cSkinEnigmaDisplayReplay::SetMode(bool Play, bool Forward, int Speed) fFoundLogo = EnigmaLogoCache.LoadIcon(Play ? "icons/replay/play" : "icons/replay/pause"); else if (Play) { if (Speed > MAX_SPEED_BITMAPS - 1) { - error("MAX SPEED %d > 9\n", Speed); + error("MAX SPEED %d > 9", Speed); Speed = MAX_SPEED_BITMAPS - 1; } fFoundLogo = EnigmaLogoCache.LoadIcon(Forward ? strFastForward_large[Speed] : strFastRewind_large[Speed]); } else { // trick speed if (Speed > MAX_TRICKSPEED_BITMAPS - 1) { - error("MAX SPEED %d > 3\n", Speed); + error("MAX SPEED %d > 3", Speed); Speed = MAX_TRICKSPEED_BITMAPS - 1; } fFoundLogo = EnigmaLogoCache.LoadIcon(Forward ? strSlowForward_large[Speed] : strSlowRewind_large[Speed]); @@ -2967,10 +3020,10 @@ cSkinEnigmaDisplayVolume::cSkinEnigmaDisplayVolume() lastTime = 0; fShowSymbol = EnigmaConfig.showSymbols && EnigmaConfig.showSymbolsAudio; - int LogoSize = max(pFontOsdTitle->Height() + - cFont::GetFont(fontOsd)->Height() + - pFontDate->Height() + - TitleDeco + SmallGap, IconHeight); + int LogoSize = std::max(pFontOsdTitle->Height() + + cFont::GetFont(fontOsd)->Height() + + pFontDate->Height() + + TitleDeco + SmallGap, IconHeight); LogoSize += (LogoSize % 2 ? 1 : 0); xLogoLeft = 0; xLogoRight = LogoSize; @@ -2997,10 +3050,10 @@ cSkinEnigmaDisplayVolume::cSkinEnigmaDisplayVolume() osd = cOsdProvider::NewOsd(OsdSize.x, OsdSize.y + OsdSize.h - yBottomBottom); tArea Areas[] = { {xLogoLeft, yLogoTop, xTitleRight - 1, yBottomBottom - 1, fShowSymbol ? 8 : 4} }; if ((Areas[0].bpp < 8 || EnigmaConfig.singleArea8Bpp) && osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk) { - debug("cSkinEnigmaDisplayVolume: using %dbpp single area\n", Areas[0].bpp); + debug("cSkinEnigmaDisplayVolume: using %dbpp single area", Areas[0].bpp); osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea)); } else { - debug("cSkinEnigmaDisplayVolume: using multiple areas\n"); + debug("cSkinEnigmaDisplayVolume: using multiple areas"); cBitmap *bitmap = NULL; if (fShowSymbol) { tArea Areas[] = { {xLogoLeft, yLogoTop, xLogoRight + LogoDecoGap + LogoDecoWidth - 1, yLogoBottom - 1, 4}, @@ -3010,7 +3063,7 @@ cSkinEnigmaDisplayVolume::cSkinEnigmaDisplayVolume() if (rc == oeOk) osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea)); else { - error("cSkinEnigmaDisplayVolume: CanHandleAreas() returned %d\n", rc); + error("cSkinEnigmaDisplayVolume: CanHandleAreas() returned %d", rc); delete osd; osd = NULL; throw 1; @@ -3024,7 +3077,7 @@ cSkinEnigmaDisplayVolume::cSkinEnigmaDisplayVolume() if (rc == oeOk) osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea)); else { - error("cSkinEnigmaDisplayVolume: CanHandleAreas() returned %d\n", rc); + error("cSkinEnigmaDisplayVolume: CanHandleAreas() returned %d", rc); delete osd; osd = NULL; throw 1; @@ -3176,14 +3229,14 @@ cSkinEnigmaDisplayTracks::cSkinEnigmaDisplayTracks(const char *Title, int NumTra currentIndex = -1; int ItemsWidth = 0; for (int i = 0; i < NumTracks; i++) - ItemsWidth = max(ItemsWidth, pFontListItem->Width(Tracks[i])); + ItemsWidth = std::max(ItemsWidth, pFontListItem->Width(Tracks[i])); ItemsWidth += (EnigmaConfig.showMarker ? lineHeight : SmallGap) + SmallGap; - ItemsWidth = max(ItemsWidth, LogoSize); + ItemsWidth = std::max(ItemsWidth, LogoSize); int width = ItemsWidth; if (fShowSymbol) width += LogoSize + LogoDecoGap2; - width = max(width, pFontDate->Width(DayDateTime()) + 2 * Roundness); - width = max(width, pFontOsdTitle->Width(Title) + 2 * Roundness + (fShowSymbol ? 0 : (bmAudio[0].Width() + SmallGap))); + width = std::max(width, pFontDate->Width(DayDateTime()) + 2 * Roundness); + width = std::max(width, pFontOsdTitle->Width(Title) + 2 * Roundness + (fShowSymbol ? 0 : (bmAudio[0].Width() + SmallGap))); xTitleLeft = 0; xTitleRight = OsdSize.w; @@ -3200,7 +3253,7 @@ cSkinEnigmaDisplayTracks::cSkinEnigmaDisplayTracks(const char *Title, int NumTra xLogoLeft = xTitleLeft; xLogoRight = xLogoLeft + LogoSize; yLogoTop = yTitleDecoBottom + TitleDecoGap2; - yLogoBottom = yLogoTop + max(LogoSize, NumTracks * lineHeight); + yLogoBottom = yLogoTop + std::max(LogoSize, NumTracks * lineHeight); xListLeft = fShowSymbol ? (xLogoRight + LogoDecoGap2) : 0; xListRight = xTitleRight; yListTop = yLogoTop; @@ -3214,10 +3267,10 @@ cSkinEnigmaDisplayTracks::cSkinEnigmaDisplayTracks(const char *Title, int NumTra osd = cOsdProvider::NewOsd(OsdSize.x, OsdSize.y + OsdSize.h - yBottomBottom); tArea Areas[] = { {xTitleLeft, yTitleTop, xBottomRight - 1, yBottomBottom - 1, fShowSymbol ? 8 : 4} }; if ((Areas[0].bpp < 8 || EnigmaConfig.singleArea8Bpp) && osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk) { - debug("cSkinEnigmaDisplayTracks: using %dbpp single area\n", Areas[0].bpp); + debug("cSkinEnigmaDisplayTracks: using %dbpp single area", Areas[0].bpp); osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea)); } else { - debug("cSkinEnigmaDisplayTracks: using multiple areas\n"); + debug("cSkinEnigmaDisplayTracks: using multiple areas"); if (fShowSymbol) { tArea Areas[] = { {xTitleLeft, yTitleTop, xTitleRight - 1, yTitleDecoBottom- 1, 2}, {xLogoLeft, yLogoTop, xLogoRight - 1, yLogoBottom - 1, 4}, @@ -3228,7 +3281,7 @@ cSkinEnigmaDisplayTracks::cSkinEnigmaDisplayTracks(const char *Title, int NumTra if (rc == oeOk) osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea)); else { - error("cSkinEnigmaDisplayTracks: CanHandleAreas() returned %d\n", rc); + error("cSkinEnigmaDisplayTracks: CanHandleAreas() returned %d", rc); delete osd; osd = NULL; throw 1; @@ -3243,7 +3296,7 @@ cSkinEnigmaDisplayTracks::cSkinEnigmaDisplayTracks(const char *Title, int NumTra if (rc == oeOk) osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea)); else { - error("cSkinEnigmaDisplayTracks: CanHandleAreas() returned %d\n", rc); + error("cSkinEnigmaDisplayTracks: CanHandleAreas() returned %d", rc); delete osd; osd = NULL; throw 1; @@ -3404,10 +3457,10 @@ cSkinEnigmaDisplayMessage::cSkinEnigmaDisplayMessage() #endif fShowSymbol = EnigmaConfig.showSymbols && EnigmaConfig.showSymbolsMsgs; - int LogoSize = max(pFontOsdTitle->Height() + TitleDeco + - pFontMessage->Height() + - 5 * SmallGap + - pFontDate->Height(), IconHeight); + int LogoSize = std::max(pFontOsdTitle->Height() + TitleDeco + + pFontMessage->Height() + + 5 * SmallGap + + pFontDate->Height(), IconHeight); LogoSize += (LogoSize % 2 ? 1 : 0); xLogoLeft = 0; @@ -3435,10 +3488,10 @@ cSkinEnigmaDisplayMessage::cSkinEnigmaDisplayMessage() osd = cOsdProvider::NewOsd(OsdSize.x, OsdSize.y + OsdSize.h - yBottomBottom); tArea Areas[] = { {xLogoLeft, yLogoTop, xBottomRight - 1, yBottomBottom - 1, fShowSymbol ? 8 : 4} }; if ((Areas[0].bpp < 8 || EnigmaConfig.singleArea8Bpp) && osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk) { - debug("cSkinEnigmaDisplayMessage: using %dbpp single area\n", Areas[0].bpp); + debug("cSkinEnigmaDisplayMessage: using %dbpp single area", Areas[0].bpp); osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea)); } else { - debug("cSkinEnigmaDisplayMessage: using multiple areas\n"); + debug("cSkinEnigmaDisplayMessage: using multiple areas"); if (fShowSymbol) { tArea Areas[] = { {xLogoLeft, yLogoTop, xLogoRight + LogoDecoGap + LogoDecoWidth - 1, yLogoBottom - 1, 4}, {xTitleLeft, yTitleTop, xBottomRight - 1, yBottomBottom - 1, 4} }; @@ -3446,7 +3499,7 @@ cSkinEnigmaDisplayMessage::cSkinEnigmaDisplayMessage() if (rc == oeOk) osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea)); else { - error("cSkinEnigmaDisplayMessage: CanHandleAreas() returned %d\n", rc); + error("cSkinEnigmaDisplayMessage: CanHandleAreas() returned %d", rc); delete osd; osd = NULL; throw 1; @@ -3458,7 +3511,7 @@ cSkinEnigmaDisplayMessage::cSkinEnigmaDisplayMessage() if (rc == oeOk) osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea)); else { - error("cSkinEnigmaDisplayMessage: CanHandleAreas() returned %d\n", rc); + error("cSkinEnigmaDisplayMessage: CanHandleAreas() returned %d", rc); delete osd; osd = NULL; throw 1; @@ -3480,7 +3533,7 @@ cSkinEnigmaDisplayMessage::cSkinEnigmaDisplayMessage() cSkinEnigmaDisplayMessage::~cSkinEnigmaDisplayMessage() { - debug("cSkinEnigmaDisplayMessage::~cSkinEnigmaDisplayMessage\n"); + debug("cSkinEnigmaDisplayMessage::~cSkinEnigmaDisplayMessage"); #ifndef DISABLE_ANIMATED_TEXT if (EnigmaConfig.useTextEffects && EnigmaConfig.scrollOther) { @@ -3493,7 +3546,7 @@ cSkinEnigmaDisplayMessage::~cSkinEnigmaDisplayMessage() void cSkinEnigmaDisplayMessage::SetMessage(eMessageType Type, const char *Text) { - debug("cSkinEnigmaDisplayMessage::SetMessage\n"); + debug("cSkinEnigmaDisplayMessage::SetMessage"); #ifndef DISABLE_ANIMATED_TEXT if (!fLocked && EnigmaConfig.useTextEffects && EnigmaConfig.scrollOther) TE_LOCK; @@ -8,13 +8,14 @@ #include "common.h" -#ifdef HAVE_FREETYPE +#if VDRVERSNUM != 10503 #include "font.h" #include <iconv.h> #include <stdio.h> cGraphtftFont::cGraphtftFont() { +#if VDRVERSNUM < 10503 _library = 0; _face = 0; @@ -24,12 +25,14 @@ cGraphtftFont::cGraphtftFont() { error("ERROR: Could not init freetype library"); } +#endif } cGraphtftFont::~cGraphtftFont() { Clear(); +#if VDRVERSNUM < 10503 if (_face) { FT_Done_Face(_face); @@ -39,6 +42,7 @@ cGraphtftFont::~cGraphtftFont() { FT_Done_FreeType(_library); } +#endif } bool cGraphtftFont::Load(string Filename, string CacheName, int Size, int Language, int Width, int format) @@ -46,6 +50,18 @@ bool cGraphtftFont::Load(string Filename, string CacheName, int Size, int Langua if ( _cache.find(CacheName) != _cache.end() ) return true; +#if VDRVERSNUM >= 10504 + //TODO: "Width" not yet in VDR +# ifdef VDRVERSNUM >= 10505 + cFont *newFont = cFont::CreateFont(Filename.c_str(), Size, Width > 0 ? (Size * Width / 100) : 0); +# else + cFont *newFont = cFont::CreateFont(Filename.c_str(), Size); +# endif + if (newFont) { + _cache[CacheName] = newFont; + return true; + } +#elif VDRVERSNUM < 10503 int error = FT_New_Face(_library, Filename.c_str(), format, &_face); // every thing ok? @@ -190,6 +206,8 @@ bool cGraphtftFont::Load(string Filename, string CacheName, int Size, int Langua return true; } delete(font_data); +#endif //VDRVERSNUM >= 10504 + // Something went wrong! return false; } @@ -215,9 +233,11 @@ void cGraphtftFont::Clear() delete((*it).second); _cache.clear(); +#if VDRVERSNUM < 10503 del_map::iterator del_it = _del.begin(); for (; del_it != _del.end(); ++del_it) delete[]((*del_it).second); _del.clear(); +#endif } -#endif //HAVE_FREETYPE +#endif //VDRVERSNUM < 10503 @@ -11,6 +11,8 @@ #include "common.h" +#if VDRVERSNUM != 10503 + #include <map> #include <vector> #include <ft2build.h> @@ -27,7 +29,9 @@ class cGraphtftFont { private: typedef map<string,cFont*> cache_map; +#if VDRVERSNUM < 10503 typedef map<string,cFont::tPixelData*> del_map; +#endif public: cGraphtftFont(); @@ -39,12 +43,14 @@ public: void Clear(); private: +#if VDRVERSNUM < 10503 FT_Library _library; FT_Face _face; FT_GlyphSlot _slot; - cache_map _cache; del_map _del; +#endif + cache_map _cache; }; - +#endif // VDRVERSNUM != 10503 #endif // VDR__GRAPHTFTFONT_H @@ -45,6 +45,160 @@ const tI18nPhrase Phrases[] = { "da_DK", // Dansk "cs_CZ", // Èesky (Czech) }, + {"Monday", // English Patrice Staudt 21.06.2007 Alle Sprache umgesetzt von LC_TIME + "Montag", // Deutsch + "ponedeljek", // Slovenski + "Lunedì", // Italiano + "maandag", // Nederlands + "Segunda", // Português + "Lundi", // Français + "Manday", // Norsk + "Maanantai", // suomi (Finnish) + "poniedzia³ek", // Polski + "Lunes", // Español + "ÄåõôÝñá", // ÅëëçíéêÜ (Greek) + "Måndag", // Svenska + "Luni", // Românã + "Hétfõ", // Magyar + "Dilluns", // Català + "¿ÞÝÕÔÕÛìÝØÚ", // ÀãááÚØÙ (Russian) + "Ponedjeljak", // Hrvatski + "Esmaspäev", // Eesti + "Mandag", // Dansk + "Pondìlí", // Èesky (Czech) + }, + {"Tuesday", // English + "Dienstag", // Deutsch + "Torek", // Slovenski + "Martedì", // Italiano + "Dinsdag", // Nederlands + "Terça", // Português + "Mardi", // Français + "Tirsday", // Norsk + "Tiistai", // suomi (Finnish) + "Wtorek", // Polski + "Martes", // Español + "Ôñßôç", // ÅëëçíéêÜ (Greek) + "Tisdag", // Svenska + "Marþi", // Românã + "Kedd", // Magyar + "Dimarts", // Català + "²âÞàÝØÚ", // ÀãááÚØÙ (Russian) + "Utorak", // Hrvatski + "Teisipäev", // Eesti + "Tirsdag", // Dansk + "Úterý", // Èesky (Czech) + }, + {"Wednesday", // English + "Mittwoch", // Deutsch + "sreda", // Slovenski + "mercoledì", // Italiano + "woensdag", // Nederlands + "Quarta", // Português + "Mercredi", // Français + "Onsday", // Norsk + "Keskiviikko", // suomi (Finnish) + "¶roda", // Polski + "Miércoles", // Español + "ÔåôÜñôç", // ÅëëçíéêÜ (Greek) + "Onsdag", // Svenska + "Miercuri", // Românã + "Szerda", // Magyar + "Dimecres", // Català + "ÁàÕÔÐ", // ÀãááÚØÙ (Russian) + "Srijeda", // Hrvatski + "Kolmapäev", // Eesti + "Onsdag", // Dansk + "Støeda", // Èesky (Czech) + }, + {"Thursday", // English + "Donnerstag", // Deutsch + "èetrtek", // Slovenski + "Giovedì", // Italiano + "Donderdag", // Nederlands + "Quinta", // Português + "Jeudi", // Français + "Torsdag", // Norsk + "Torstai", // suomi (Finnish) + "Czwartek", // Polski + "Jueves", // Español + "ÐÝìðôç", // ÅëëçíéêÜ (Greek) + "Torsdag", // Svenska + "Joi", // Românã + "Csütörtök", // Magyar + "Dijous", // Català + "ÇÕâÒÕàÓ", // ÀãááÚØÙ (Russian) + "Èetvrtak", // Hrvatski + "Neljapäev", // Eesti + "Torsdag", // Dansk + "Ètvrtek", // Èesky (Czech) + }, + {"Friday", // English + "Freitag", // Deutsch + "Petek", // Slovenski + "Venerdì", // Italiano + "Vrijdag", // Nederlands + "Sexta", // Português + "Vendredi", // Français + "Fredag", // Norsk + "Perjantai", // suomi (Finnish) + "Pi±tek", // Polski + "Viernes", // Español + "ÐáñáóêåõÞ", // ÅëëçíéêÜ (Greek) + "Fredag", // Svenska + "Vineri", // Românã + "Péntek", // Magyar + "Divendres", // Català + "¿ïâÝØæÐ", // ÀãááÚØÙ (Russian) + "Petak", // Hrvatski + "Reede", // Eesti + "Fredag", // Dansk + "Pátek", // Èesky (Czech) + }, + {"Saturday", // English + "Samstag", // Deutsch + "Sobota", // Slovenski + "Sabato", // Italiano + "Zaterdag", // Nederlands + "Sábado", // Português + "Samedi", // Français + "Lørdag", // Norsk + "Lauantai", // suomi (Finnish) + "Sobota", // Polski + "Sábado", // Español + "ÓÜââáôï", // ÅëëçíéêÜ (Greek) + "Lördag", // Svenska + "Sâmbãtã", // Românã + "Szombat", // Magyar + "Dissabte", // Català + "ÁãÑÑÞâÐ", // ÀãááÚØÙ (Russian) + "Subota", // Hrvatski + "Laupäev", // Eesti + "Lørdag", // Dansk + "Sobota", // Èesky (Czech) + }, + {"Sunday", // English + "Sonntag", // Deutsch + "Nedelja", // Slovenski + "Domenica", // Italiano + "Zondag", // Nederlands + "Domingo", // Português + "Dimanche", // Français + "Søndag", // Norsk + "Sunnuntai", // suomi (Finnish) + "Niedziela", // Polski + "Domingo", // Español + "ÊõñéáêÞ", // ÅëëçíéêÜ (Greek) + "Söndag", // Svenska + "Duminicã", // Românã + "Vasárnap", // Magyar + "Diumenge", // Català + "²ÞáÚàÕáÕÝìÕ", // ÀãááÚØÙ (Russian) + "Nedjelja", // Hrvatski + "Pühapäev", // Eesti + "Søndag", // Dansk + "Nedìle", // Èesky (Czech) + }, {"EnigmaNG skin", // English "EnigmaNG Oberfläche", // Deutsch "", // Slovenski @@ -535,7 +689,7 @@ const tI18nPhrase Phrases[] = { "Mostra indicatore negli elenchi", // Italiano "Markering in lijsten tonen", // Nederlands "", // Português - "Symbole dans les listes", // Français + "Marque devant les listes", // Français "", // Norsk "Näytä valintasymboli", // suomi (Finnish) "", // Polski @@ -1283,7 +1437,7 @@ const tI18nPhrase Phrases[] = { " Lunghezza immagine", // Italiano " Beeldbreedte", // Nederlands "", // Português - " Largeur d'image ", // Français + " Largeur", // Français "", // Norsk " Kuvien leveys", // suomi (Finnish) "", // Polski @@ -1305,7 +1459,7 @@ const tI18nPhrase Phrases[] = { " Altezza immagine", // Italiano " Beeldhoogte", // Nederlands "", // Português - " Hauteur d'image", // Français + " Hauteur", // Français "", // Norsk " Kuvien korkeus", // suomi (Finnish) "", // Polski @@ -1683,7 +1837,7 @@ const tI18nPhrase Phrases[] = { " Mostra simboli nel menu", // Italiano "", // Nederlands "", // Português - " Afficher les symboles dans le menu", // Français + " dans le menu", // Français "", // Norsk " Näytä symbolit valikossa", // suomi (Finnish) "", // Polski @@ -1705,7 +1859,7 @@ const tI18nPhrase Phrases[] = { " Mostra simboli in esecuzione",// Italiano "", // Nederlands "", // Português - " Afficher les symboles dans lecture", // Français + " dans lecture", // Français "", // Norsk " Näytä symbolit toistettaessa", // suomi (Finnish) "", // Polski @@ -1727,7 +1881,7 @@ const tI18nPhrase Phrases[] = { " Mostra simboli nei messaggi",// Italiano "", // Nederlands "", // Português - " Afficher les symboles dans les messages", // Français + " dans les messages", // Français "", // Norsk " Näytä symbolit viesteissä", // suomi (Finnish) "", // Polski @@ -1749,7 +1903,7 @@ const tI18nPhrase Phrases[] = { " Mostra simboli in audio", // Italiano "", // Nederlands "", // Português - " Afficher les symboles dans audio", // Français + " dans audio", // Français "", // Norsk " Näytä symbolit äänivalikossa", // suomi (Finnish) "", // Polski @@ -1773,7 +1927,7 @@ const tI18nPhrase Phrases[] = { "", // Português "Les polices", // Français "", // Norsk - "Kirjasimet", // suomi (Finnish) + "Kirjasintyypit", // suomi (Finnish) "", // Polski "", // Español "", // ÅëëçíéêÜ (Greek) @@ -1817,7 +1971,7 @@ const tI18nPhrase Phrases[] = { "", // Português "Date", // Français "", // Norsk - "", // suomi (Finnish) + "Päiväys", // suomi (Finnish) "", // Polski "", // Español "", // ÅëëçíéêÜ (Greek) @@ -2169,7 +2323,7 @@ const tI18nPhrase Phrases[] = { "", // Português "OSD standart", // Français "", // Norsk - "oletuskirjasin", // suomi (Finnish) + "oletuskirjasintyyppi", // suomi (Finnish) "", // Polski "", // Español "", // ÅëëçíéêÜ (Greek) @@ -2191,7 +2345,7 @@ const tI18nPhrase Phrases[] = { "", // Português "Largeur fixe standart", // Français "", // Norsk - "kiinteäkokoinen oletuskirjasin", // suomi (Finnish) + "tasavälinen kirjasintyyppi", // suomi (Finnish) "", // Polski "", // Español "", // ÅëëçíéêÜ (Greek) @@ -2213,7 +2367,7 @@ const tI18nPhrase Phrases[] = { "", // Português "Petite standart", // Français "", // Norsk - "pieni oletuskirjasin", // suomi (Finnish) + "pieni kirjasintyyppi", // suomi (Finnish) "", // Polski "", // Español "", // ÅëëçíéêÜ (Greek) @@ -2411,7 +2565,7 @@ const tI18nPhrase Phrases[] = { "", // Português "Les polices TrueType ne sont pas supportées!", // Français "", // Norsk - "Ei TTF-tukea!", // suomi (Finnish) + "Ei TrueType-kirjasintyyppi tukea!", // suomi (Finnish) "", // Polski "", // Español "", // ÅëëçíéêÜ (Greek) @@ -2433,7 +2587,7 @@ const tI18nPhrase Phrases[] = { "", // Português "", // Français "", // Norsk - "", // suomi (Finnish) + "Tasavälinen kirjasintyyppi", // suomi (Finnish) "", // Polski "", // Español "", // ÅëëçíéêÜ (Greek) @@ -2456,7 +2610,7 @@ const tI18nPhrase Phrases[] = { "", // Português "", // Français "", // Norsk - "", // suomi (Finnish) + "Vaihtuva kuvaruutunäytön koko", // suomi (Finnish) "", // Polski "", // Español "", // ÅëëçíéêÜ (Greek) @@ -2479,7 +2633,7 @@ const tI18nPhrase Phrases[] = { "", // Português "", // Français "", // Norsk - "", // suomi (Finnish) + "TrueType-kirjasintyyppejä ei löydy!", // suomi (Finnish) "", // Polski "", // Español "", // ÅëëçíéêÜ (Greek) @@ -33,7 +33,7 @@ cEnigmaLogoCache::~cEnigmaLogoCache() bool cEnigmaLogoCache::Resize(unsigned int cacheSizeP) { - debug("cPluginSkinEnigma::Resize(%d)\n", cacheSizeP); + debug("cPluginSkinEnigma::Resize(%d)", cacheSizeP); // flush cache only if it's smaller than before if (cacheSizeP < cacheSizeM) { Flush(); @@ -74,7 +74,7 @@ bool cEnigmaLogoCache::DrawImage(const char *fileNameP, int x, int y, int w, int struct stat stbuf; if (lstat(fileNameP, &stbuf) != 0) { - error("cPluginSkinEnigma::LoadImage(%s) FILE NOT FOUND\n", fileNameP); + error("cPluginSkinEnigma::LoadImage(%s) FILE NOT FOUND", fileNameP); bitmapM = NULL; return false; } @@ -107,7 +107,7 @@ bool cEnigmaLogoCache::LoadChannelLogo(const cChannel *Channel) strcpy(filename, "logos/"); strcat(filename, logoname); if (!(fFoundLogo = Load(filename, ChannelLogoWidth, ChannelLogoHeight, false))) { - error("cPluginSkinEnigma::LoadChannelLogo: LOGO \"%s.xpm\" NOT FOUND in %s/[hq]logos\n", logoname, EnigmaConfig.GetLogoDir()); + error("cPluginSkinEnigma::LoadChannelLogo: LOGO \"%s.xpm\" NOT FOUND in %s/[hq]logos", logoname, EnigmaConfig.GetLogoDir()); fFoundLogo = Load("hqlogos/no_logo", ChannelLogoWidth, ChannelLogoHeight); //TODO? different default logo for channel/group? } } @@ -137,15 +137,15 @@ bool cEnigmaLogoCache::Load(const char *fileNameP, int w, int h, bool fLogNotFou if (strFilename == NULL) return false; - debug("cPluginSkinEnigma::Load(%s)\n", strFilename); + debug("cPluginSkinEnigma::Load(%s)", strFilename); // does the logo exist already in map std::map < std::string, cBitmap * >::iterator i = cacheMapM.find(strFilename); if (i != cacheMapM.end()) { // yes - cache hit! - debug("cPluginSkinEnigma::Load() CACHE HIT!\n"); + debug("cPluginSkinEnigma::Load() CACHE HIT!"); // check if logo really exist if (i->second == NULL) { - debug("cPluginSkinEnigma::Load() EMPTY\n"); + debug("cPluginSkinEnigma::Load() EMPTY"); // empty logo in cache free(strFilename); return false; @@ -153,7 +153,7 @@ bool cEnigmaLogoCache::Load(const char *fileNameP, int w, int h, bool fLogNotFou bitmapM = i->second; } else { // no - cache miss! - debug("cPluginSkinEnigma::Load() CACHE MISS!\n"); + debug("cPluginSkinEnigma::Load() CACHE MISS!"); // try to load xpm logo if (!LoadXpm(strFilename, w, h, fLogNotFound)) return false; @@ -162,7 +162,7 @@ bool cEnigmaLogoCache::Load(const char *fileNameP, int w, int h, bool fLogNotFou // update map if (cacheMapM.size() >= cacheSizeM) { // cache full - remove first - debug("cPluginSkinEnigma::Load() DELETE\n"); + debug("cPluginSkinEnigma::Load() DELETE"); if (cacheMapM.begin()->second != NULL) { // logo exists - delete it cBitmap *bmp = cacheMapM.begin()->second; @@ -172,12 +172,12 @@ bool cEnigmaLogoCache::Load(const char *fileNameP, int w, int h, bool fLogNotFou cacheMapM.erase(cacheMapM.begin()); } // insert logo into map - debug("cPluginSkinEnigma::Load() INSERT(%s)\n", strFilename); + debug("cPluginSkinEnigma::Load() INSERT(%s)", strFilename); cacheMapM.insert(std::make_pair(strFilename, bitmapM)); } // check if logo really exist if (bitmapM == NULL) { - debug("cPluginSkinEnigma::Load() EMPTY\n"); + debug("cPluginSkinEnigma::Load() EMPTY"); // empty logo in cache free(strFilename); return false; @@ -201,22 +201,22 @@ bool cEnigmaLogoCache::LoadXpm(const char *fileNameP, int w, int h, bool fLogNot cBitmap *bmp = new cBitmap(1, 1, 1); // create absolute filename - debug("cPluginSkinEnigma::LoadXpm(%s)\n", fileNameP); + debug("cPluginSkinEnigma::LoadXpm(%s)", fileNameP); // check validity if ((lstat(fileNameP, &stbuf) == 0) && bmp->LoadXpm(fileNameP)) { if ((bmp->Width() <= w) && (bmp->Height() <= h)) { - debug("cPluginSkinEnigma::LoadXpm(%s) LOGO FOUND\n", fileNameP); + debug("cPluginSkinEnigma::LoadXpm(%s) LOGO FOUND", fileNameP); // assign bitmap bitmapM = bmp; return true; } else { // wrong size - error("cPluginSkinEnigma::LoadXpm(%s) LOGO HAS WRONG SIZE %d/%d (%d/%d)\n", fileNameP, bmp->Width(), bmp->Height(), w, h); + error("cPluginSkinEnigma::LoadXpm(%s) LOGO HAS WRONG SIZE %d/%d (%d/%d)", fileNameP, bmp->Width(), bmp->Height(), w, h); } } else { // no xpm logo found if (fLogNotFound) - error("cPluginSkinEnigma::LoadXpm(%s) LOGO NOT FOUND\n", fileNameP); + error("cPluginSkinEnigma::LoadXpm(%s) LOGO NOT FOUND", fileNameP); } delete bmp; @@ -226,10 +226,10 @@ bool cEnigmaLogoCache::LoadXpm(const char *fileNameP, int w, int h, bool fLogNot bool cEnigmaLogoCache::Flush(void) { - debug("cPluginSkinEnigma::Flush()\n"); + debug("cPluginSkinEnigma::Flush()"); // check if map is empty if (!cacheMapM.empty()) { - debug("cPluginSkinEnigma::Flush() NON-EMPTY\n"); + debug("cPluginSkinEnigma::Flush() NON-EMPTY"); // delete bitmaps and clear map for (std::map<std::string, cBitmap *>::iterator i = cacheMapM.begin(); i != cacheMapM.end(); i++) { delete((*i).second); @@ -32,7 +32,7 @@ static const char *allVdrFonts[] = { cPluginSkinEnigmaSetup::cPluginSkinEnigmaSetup(void) { // create setup menu - debug("cPluginSkinEnigmaSetup()\n"); + debug("cPluginSkinEnigmaSetup()"); data = EnigmaConfig; Setup(); @@ -41,7 +41,7 @@ cPluginSkinEnigmaSetup::cPluginSkinEnigmaSetup(void) void cPluginSkinEnigmaSetup::AddCategory(const char *Title) { char *buffer = NULL; - asprintf(&buffer, "--- %s ----------------------------------------------------------------------------------", Title ); + asprintf(&buffer, "---\t%s ----------------------------------------------------------------------------------", Title ); cOsdItem *item = new cOsdItem(buffer); free(buffer); @@ -79,7 +79,7 @@ void cPluginSkinEnigmaSetup::Setup(void) void cPluginSkinEnigmaSetup::Store(void) { // store setup data - debug("cPluginSkinEnigmaSetup::Store()\n"); + debug("cPluginSkinEnigmaSetup::Store()"); EnigmaConfig = data; SetupStore("SingleArea8Bpp", EnigmaConfig.singleArea8Bpp); @@ -416,8 +416,10 @@ void cMenuSetupTTF::Set(void) if (availTTFs) { Add(new cMenuEditStraItem(tr("Name"), &nFont, nMaxTTFs, availTTFs)); Add(new cMenuEditIntItem(tr("Size"), &nSize, 10, MAXFONTSIZE)); - Add(new cMenuEditIntItem(tr("Width"), &nWidth, 50, 150)); - +#if VDRVERSNUM < 10503 || VDRVERSNUM >= 10505 + //VDR >1.5.2 cant's set TTF width + Add(new cMenuEditIntItem(tr("Width"), &nWidth, 80, 120)); +#endif SetCurrent(Get(current)); } else { cOsdItem *item = new cOsdItem(tr("No TrueType fonts installed!")); diff --git a/skinenigmang.c b/skinenigmang.c index d60d28c..8d4d86c 100644 --- a/skinenigmang.c +++ b/skinenigmang.c @@ -24,7 +24,7 @@ #warning "YOU NEED A PATCHED VDR 1.5.3 OR EnigmaNG WILL CRASH!" #endif -static const char VERSION[] = "0.0.5rc2"; +static const char VERSION[] = "0.0.5rc3"; static const char DESCRIPTION[] = "EnigmaNG skin"; class cPluginSkinEnigma : public cPlugin { @@ -132,14 +132,14 @@ bool cPluginSkinEnigma::ProcessArgs(int argc, char *argv[]) bool cPluginSkinEnigma::Initialize(void) { // initialize any background activities the plugin shall perform. - debug("cPluginSkinEnigma::Initialize()\n"); + debug("cPluginSkinEnigma::Initialize()"); return true; } bool cPluginSkinEnigma::Start(void) { // start any background activities the plugin shall perform. - debug("cPluginSkinEnigma::Start()\n"); + debug("cPluginSkinEnigma::Start()"); RegisterI18n(Phrases); if (!fLogodirSet) { // set logo directory @@ -179,7 +179,7 @@ bool cPluginSkinEnigma::Start(void) void cPluginSkinEnigma::Stop(void) { // stop any background activities the plugin shall perform. - debug("cPluginSkinEnigma::Stop()\n"); + debug("cPluginSkinEnigma::Stop()"); } void cPluginSkinEnigma::Housekeeping(void) @@ -196,14 +196,14 @@ cOsdObject *cPluginSkinEnigma::MainMenuAction(void) cMenuSetupPage *cPluginSkinEnigma::SetupMenu(void) { // return a setup menu in case the plugin supports one. - debug("cPluginSkinEnigma::SetupMenu()\n"); + debug("cPluginSkinEnigma::SetupMenu()"); return new cPluginSkinEnigmaSetup(); } bool cPluginSkinEnigma::SetupParse(const char *Name, const char *Value) { // parse your own setup parameters and store their values. -// debug("cPluginSkinEnigma::SetupParse()\n"); +// debug("cPluginSkinEnigma::SetupParse()"); if (!strcasecmp(Name, "SingleArea8Bpp")) EnigmaConfig.singleArea8Bpp = atoi(Value); else if (!strcasecmp(Name, "ShowAuxInfo")) EnigmaConfig.showAuxInfo = atoi(Value); @@ -25,7 +25,7 @@ cEnigmaStatus::cEnigmaStatus(void) : mReplayMode(replayNone), void cEnigmaStatus::Replaying(const cControl * /*Control */ , const char *Name, const char *FileName, bool On) { - debug("cEnigmaStatus::Replaying(%s)\n", Name); + debug("cEnigmaStatus::Replaying(%s)", Name); if (Name != NULL) { mReplayMode = replayMPlayer; diff --git a/texteffects.c b/texteffects.c index 37dfd13..323a6c1 100644 --- a/texteffects.c +++ b/texteffects.c @@ -16,15 +16,15 @@ #ifdef HAVE_FREETYPE // needed for case-insensitive sort of vector (for fonts) struct NoCase { - bool operator()(const string& x, const string& y) { - string lv(x); - string rv(y); + bool operator()(const std::string& x, const std::string& y) { + std::string lv(x); + std::string rv(y); lcase(lv); lcase(rv); return lv < rv; } - void lcase(string& s) { + void lcase(std::string& s) { int n = s.size(); for(int i = 0; i < n; i++) s[i] = tolower(s[i]); @@ -78,7 +78,7 @@ void cEnigmaTextEffects::Action(void) mutexRunning.Lock(); mutexSleep.Lock(); - debug("cEnigmaTextEffects::Action() %p\n", pthread_self()); + debug("cEnigmaTextEffects::Action() %lu", pthread_self()); while (EnigmaConfig.useTextEffects && osd) { uint64_t nNow = cTimeMs::Now(); @@ -97,7 +97,7 @@ void cEnigmaTextEffects::Action(void) } // printf("NOW=%llu NEXT=%llu DIFF=%d SLEEP=%d\n", nNow, e->nNextUpdate, (int)(e->nNextUpdate - nNow), nSleepMs); - int nDiff = max(3, (int)(e->nNextUpdate - nNow)); + int nDiff = std::max(3, (int)(e->nNextUpdate - nNow)); if (nSleepMs == 0 || nDiff < nSleepMs) nSleepMs = nDiff; } @@ -107,12 +107,12 @@ void cEnigmaTextEffects::Action(void) TE_UNLOCK; if (osd) { -// printf("SLEEP1: %d, %p\n", nSleepMs, pthread_self()); +// printf("SLEEP1: %d, %lu\n", nSleepMs, pthread_self()); if (nSleepMs) condSleep.TimedWait(mutexSleep, nSleepMs); else condSleep.TimedWait(mutexSleep, EnigmaConfig.scrollPause); //TODO -// printf("SLEEP2: %d, %p\n", nSleepMs, pthread_self()); +// printf("SLEEP2: %d, %lu\n", nSleepMs, pthread_self()); } } @@ -137,7 +137,7 @@ void cEnigmaTextEffects::DoEffect(tEffect *e, uint64_t nNow) void cEnigmaTextEffects::DoScroll(tEffect *e, uint64_t nNow, bool fDrawItem) { -// debug("cEnigmaTextEffects::DoScroll()\n"); +// debug("cEnigmaTextEffects::DoScroll()"); if (e->Font->Width(e->strText.c_str()) <= e->Width) { if (fDrawItem) { if (e->Skin) @@ -196,7 +196,7 @@ void cEnigmaTextEffects::DoScroll(tEffect *e, uint64_t nNow, bool fDrawItem) void cEnigmaTextEffects::DoBlink(tEffect *e, uint64_t nNow, bool fDrawItem) { -// debug("cEnigmaTextEffects::DoBlink()\n"); +// debug("cEnigmaTextEffects::DoBlink()"); if (fDrawItem) { if (nNow) { e->nDirection = (e->nDirection == 0 ? 1 : 0); @@ -218,13 +218,13 @@ bool cEnigmaTextEffects::Start(cOsd *o) if (!EnigmaConfig.useTextEffects) return false; - debug("cEnigmaTextEffects::Start(%p) %p\n", osd, pthread_self()); + debug("cEnigmaTextEffects::Start(%p) %lu", osd, pthread_self()); if (osd == NULL) return false; if (Running()) { - error("cEnigmaTextEffects::Start - already running\n"); + error("cEnigmaTextEffects::Start - already running"); return false; //TODO? maybe Cancel() } @@ -238,7 +238,7 @@ void cEnigmaTextEffects::Stop(void) { //Must be TE_LOCKed by caller (calls TE_UNLOCK) - debug("cEnigmaTextEffects::Stop()\n"); + debug("cEnigmaTextEffects::Stop()"); osd = NULL; Clear(); TE_UNLOCK; @@ -249,7 +249,7 @@ void cEnigmaTextEffects::Stop(void) void cEnigmaTextEffects::Clear(void) { - debug("cEnigmaTextEffects::Clear()\n"); + debug("cEnigmaTextEffects::Clear()"); //Must be TE_LOCKed by caller @@ -262,7 +262,7 @@ void cEnigmaTextEffects::Clear(void) void cEnigmaTextEffects::PauseEffects(int y) { - debug("cEnigmaTextEffects::PauseEffects(%d)\n", y); + debug("cEnigmaTextEffects::PauseEffects(%d)", y); //Must be TE_LOCKed by caller @@ -271,7 +271,7 @@ void cEnigmaTextEffects::PauseEffects(int y) void cEnigmaTextEffects::ResetText(int i, tColor ColorFg, tColor ColorBg, bool fDraw) { - debug("cEnigmaTextEffects::ResetText(%d)\n", i); + debug("cEnigmaTextEffects::ResetText(%d)", i); //Must be TE_LOCKed by caller @@ -288,11 +288,13 @@ void cEnigmaTextEffects::ResetText(int i, tColor ColorFg, tColor ColorBg, bool f delete(e); vecEffects[i] = NULL; } + if (i == (int)vecEffects.size() - 1) + vecEffects.resize(vecEffects.size() - 1); } void cEnigmaTextEffects::UpdateTextWidth(int i, int Width) { - debug("cEnigmaTextEffects::UpdateTextWidth(%d)\n", i); + debug("cEnigmaTextEffects::UpdateTextWidth(%d)", i); //Must be TE_LOCKed by caller @@ -312,7 +314,7 @@ int cEnigmaTextEffects::DrawAnimatedTitle(int o_id, int action, const char *s, c if (Font == NULL || osd == NULL || skin == NULL) return -1; - debug("cEnigmaTextEffects::DrawAnimatedTitle(%d, %d, %s)\n", o_id, EnigmaConfig.useTextEffects, s); + debug("cEnigmaTextEffects::DrawAnimatedTitle(%d, %d, %s)", o_id, EnigmaConfig.useTextEffects, s); if (o_id >= 0) { // Update animated text @@ -345,8 +347,7 @@ int cEnigmaTextEffects::DrawAnimatedTitle(int o_id, int action, const char *s, c effect->Font = Font; effect->Skin = skin; vecEffects.push_back(effect); - int id = vecEffects.size() - 1; - return id; + return vecEffects.size() - 1; } else { return -1; } @@ -360,7 +361,7 @@ int cEnigmaTextEffects::DrawAnimatedText(int o_id, int action, int x, int y, con if (Font == NULL || osd == NULL) return -1; - debug("cEnigmaTextEffects::DrawAnimatedText(%d, %d, %s)\n", o_id, EnigmaConfig.useTextEffects, s); + debug("cEnigmaTextEffects::DrawAnimatedText(%d, %d, %s)", o_id, EnigmaConfig.useTextEffects, s); if (o_id >= 0) { // Update animated text @@ -399,8 +400,7 @@ int cEnigmaTextEffects::DrawAnimatedText(int o_id, int action, int x, int y, con effect->Font = Font; effect->Alignment = Alignment; vecEffects.push_back(effect); - int id = vecEffects.size() - 1; - return id; + return vecEffects.size() - 1; } } #endif //DISABLE_ANIMATED_TEXT @@ -415,10 +415,10 @@ const char **cEnigmaTextEffects::GetAvailTTFs(void) while ((e = d.Next()) != NULL) { if ((strcmp(e->d_name, ".") != 0) && (strcmp(e->d_name, "..") != 0)) { if (strcmp(e->d_name + strlen(e->d_name) - 4, ".ttf") == 0) { - debug("Loading %s\n", e->d_name); + debug("Loading %s", e->d_name); vecFonts.push_back(std::string(e->d_name)); } else { - error("Ignoring non-font file: %s\n", e->d_name); + error("Ignoring non-font file: %s", e->d_name); } } } @@ -428,7 +428,7 @@ const char **cEnigmaTextEffects::GetAvailTTFs(void) availTTFs = (char **)calloc(vecFonts.size() + 1, sizeof(char*)); if (availTTFs) { char **ptr = availTTFs; - for (vector<std::string>::iterator i = vecFonts.begin(); i != vecFonts.end(); i++) { + for (std::vector<std::string>::iterator i = vecFonts.begin(); i != vecFonts.end(); i++) { if (!(*i).empty()) { *ptr = strdup((*i).c_str()); ptr++; diff --git a/texteffects.h b/texteffects.h index eb6dd8a..5f1d61d 100644 --- a/texteffects.h +++ b/texteffects.h @@ -89,11 +89,11 @@ private: void Wakeup(void) { -// printf("WAKE1: %p\n", pthread_self()); +// printf("WAKE1: %lu\n", pthread_self()); mutexSleep.Lock(); condSleep.Broadcast(); mutexSleep.Unlock(); -// printf("WAKE2: %p\n", pthread_self()); +// printf("WAKE2: %lu\n", pthread_self()); } #endif //DISABLE_ANIMATED_TEXT @@ -120,16 +120,16 @@ public: void UpdateLock(void) { -// printf("LOCK1: %p\n", pthread_self()); +// printf("LOCK1: %lu\n", pthread_self()); Lock(); -// printf("LOCK2: %p\n", pthread_self()); +// printf("LOCK2: %lu\n", pthread_self()); } void UpdateUnlock(void) { -// printf("UNLOCK1: %p\n", pthread_self()); +// printf("UNLOCK1: %lu\n", pthread_self()); Unlock(); -// printf("UNLOCK2: %p\n", pthread_self()); +// printf("UNLOCK2: %lu\n", pthread_self()); } void RefreshEffects(void) @@ -10,16 +10,6 @@ #include "common.h" -#ifdef min -#undef min -#endif -#define min(x, y) (x < y ? x : y) - -#ifdef max -#undef max -#endif -#define max(x, y) (x > y ? x : y) - std::string parseaux(const char *str); bool ischaracters(const char *aux, const char *mask); |