From b968a310699595ff139278440ae278aebf112c1f Mon Sep 17 00:00:00 2001 From: lordjaxom Date: Mon, 31 May 2004 19:56:56 +0000 Subject: - "Background" may be initialized with a color now - fixed channel name/number display - added parameter type (to store logo's filetype) - "Timebar", "Progressbar" and "Volumebar": Background is only drawn if bg is specified - fixed timebar (was running backwards) - renamed "Progressbar" to "Replaybar" for more consistency - renamed "Logo" to "ChannelLogo" - introduced items "Language" (for audio language texts or symbols) and "Image" (foreground images) - adopted SKINS document (SKINS.de is not up-to-date yet) - introduced item "MenuTitle" - introduced items "MenuRed", "MenuGreen", "MenuYellow" and "MenuBlue" - activated message items for display in menu - introcuded parameter "arc" and item "Slope" - fixed possible segfault in Item=Message - implemented items "SymbolReplaying" and "SymbolRadio" - added "text" parameter for all text like Items (explanation follows) - added "SymbolPlay", "SymbolPause", "SymbolFastFwd", "SymbolFastRew", "SymbolSlowFwd", "SymbolSlowRew" items. --- common.c | 49 ++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 38 insertions(+), 11 deletions(-) (limited to 'common.c') diff --git a/common.c b/common.c index b3922aa..802c9c2 100644 --- a/common.c +++ b/common.c @@ -1,8 +1,10 @@ /* - * $Id: common.c,v 1.1.1.1 2004/05/23 00:08:03 lordjaxom Exp $ + * $Id: common.c,v 1.4 2004/05/31 19:54:12 lordjaxom Exp $ */ +#define __STL_CONFIG_H #include +#undef __STL_CONFIG_H #include "data.h" #include "common.h" @@ -10,16 +12,6 @@ const char *SkinPath(void) { return cPlugin::ConfigDirectory(PLUGIN_NAME_I18N); } -const cFont *SkinFont(cText2SkinItem *Item) { - const cFont *font; - font = cFont::GetFont(fontOsd); - if (Item->Font()) { - if (strcmp(Item->Font(), "Sml") == 0) font = cFont::GetFont(fontSml); - else if (strcmp(Item->Font(), "Fix") == 0) font = cFont::GetFont(fontFix); - } - return font; -} - void DrawTextTransparent(cOsd *Osd, int x, int y, const char *s, tColor ColorFg, tColor ColorBg, const cFont *Font, int Width, int Height, int Alignment) { int w = Font->Width(s); int h = Font->Height(); @@ -69,3 +61,38 @@ void DrawTextTransparent(cOsd *Osd, int x, int y, const char *s, tColor ColorFg, x += CharData->width; } } + +const char *ChannelNumber(const cChannel *Channel, int Number) { + static char buffer[256]; + buffer[0] = '\0'; + if (Channel) { + if (!Channel->GroupSep()) + snprintf(buffer, sizeof(buffer), "%d%s", Channel->Number(), Number ? "-" : ""); + } + else if (Number) + snprintf(buffer, sizeof(buffer), "%d-", Number); + return buffer; +} + +const char *ChannelName(const cChannel *Channel, int Number) { + static char buffer[256]; + buffer[0] = '\0'; + if (Channel) + snprintf(buffer, sizeof(buffer), "%s", Channel->Name()); + else if (!Number) + snprintf(buffer, sizeof(buffer), "%s", tr("*** Invalid Channel ***")); + return buffer; +} + +string ItemText(cText2SkinItem *Item, const string &Content) { + string s; + if (Item->Text() != "") { + s = Item->Text(); + int pos; + while ((pos = s.find('$')) != -1) + s.replace(pos, 1, Content); + } else + s = Content; + return s; +} + -- cgit v1.2.3