summaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
authorAndreas Mair <amair.sob@googlemail.com>2007-06-25 12:44:11 +0200
committerAndreas Mair <amair.sob@googlemail.com>2007-06-25 12:44:11 +0200
commitfc61e314442d22bb7886dba77380497b776fcb62 (patch)
treeb6e891bb760438f2209d5f24ab489d8d01579026 /config.c
parentae9c6ccad6ba1ab419fe73d9e75f545cbbb62c96 (diff)
downloadvdr-plugin-skinenigmang-0.0.5rc3.tar.gz
vdr-plugin-skinenigmang-0.0.5rc3.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.
Diffstat (limited to 'config.c')
-rw-r--r--config.c62
1 files changed, 42 insertions, 20 deletions
diff --git a/config.c b/config.c
index 8885e01..62b33cf 100644
--- a/config.c
+++ b/config.c
@@ -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: