diff options
author | Andreas Mair <amair.sob@googlemail.com> | 2007-04-02 11:38:08 +0200 |
---|---|---|
committer | Andreas Mair <amair.sob@googlemail.com> | 2007-04-02 11:38:08 +0200 |
commit | c562d549bc6274265991eec634f99b1e311323df (patch) | |
tree | 2f4f23396e60f381cb2899ef7be87c1b54dc153c /skinenigmang.c | |
parent | de39678a54ab87364a3c8c5e3b058d313451db5b (diff) | |
download | vdr-plugin-skinenigmang-c562d549bc6274265991eec634f99b1e311323df.tar.gz vdr-plugin-skinenigmang-c562d549bc6274265991eec634f99b1e311323df.tar.bz2 |
2007-04-02: Version 0.0.4v0.0.4
- Changed text color in themes for green and yellow buttons.
- Fixed false colors problem after theme changes.
- Updated Finnish translation. (Submitted by Rolf Ahrenberg)
- Updated French translation. (Submitted by pat @vdr-portal.de)
- Do not overwrite status messages in mainmenu with list items.
- New setup option that replaces SKINENIGMA_FULL_CHANNELINFO_TITLE define.
- Disable logos/symbols/flags if 4bpp single area is configured in setup. (Will eventually replace SKINENIGMA_NO_MENULOGO define)
- Added support for mailbox plugin; shows mail symbol in channel info (Based on patch by triple955 @vdr-portal.de).
- Introduced new HAVE_IMAGEMAGICK define to enable non-xpm images in event's and recording's details.
- Fixed "blinking" date in channel info (Reported by several people).
- Changed background for recording symbol in channel info to white (Suggested by gromit @vdr-portal.de).
- Long channel group names are no longer drawn at the right side of the date (Reported by several people).
- New setup option for displaying a recording's size and use size.vdr (Suggested by vejoun @vdr-portal.de).
- Show stop time of running timers in info area in main menu. (Suggested by viking @vdr-portal.de)
- Updated Russian translation. (Submitted by neptunvasja @vdr-portal.de)
- New defines "ListProgressBarGap" & "ListProgressBarBorder" to customize the progressbar in lists:
* "ListProgressBarGap" sets the gap above/below the progressbar (relative to the font's height).
* "ListProgressBarBorder" sets the border's width.
- Added fallback to "classic" skin if any of the OSD menus fails to open.
- Fix possible NULL pointer accesses.
- Fixed compiler error with certain gcc versions.
- Minor bugfixes and graphical changes.
Diffstat (limited to 'skinenigmang.c')
-rw-r--r-- | skinenigmang.c | 209 |
1 files changed, 164 insertions, 45 deletions
diff --git a/skinenigmang.c b/skinenigmang.c index 323cffb..10ad221 100644 --- a/skinenigmang.c +++ b/skinenigmang.c @@ -18,12 +18,13 @@ #error "VDR-1.4.0 API version or greater is required!" #endif -static const char VERSION[] = "0.0.3"; +static const char VERSION[] = "0.0.4"; static const char DESCRIPTION[] = "EnigmaNG skin"; class cPluginSkinEnigma : public cPlugin { private: - bool fLogodirSet; + bool fLogodirSet; + bool fImagesDirSet; public: cPluginSkinEnigma(void); @@ -61,6 +62,11 @@ private: const char *showSymbolsTexts[4]; const char *showRemainingTexts[3]; const char *useSubtitleRerunTexts[3]; + const char *showRecSizeTexts[3]; + const char *resizeImagesTexts[3]; +#ifdef USE_PLUGIN_MAILBOX + const char *showMailIconTexts[3]; +#endif virtual void Setup(void); void AddCategory(const char *Title); @@ -76,7 +82,8 @@ cPluginSkinEnigma::cPluginSkinEnigma(void) // initialize any member variables here. // DON'T DO ANYTHING ELSE THAT MAY HAVE SIDE EFFECTS, REQUIRE GLOBAL // VDR OBJECTS TO EXIST OR PRODUCE ANY OUTPUT! - fLogodirSet = false; + fLogodirSet = false; + fImagesDirSet = false; } cPluginSkinEnigma::~cPluginSkinEnigma() @@ -87,28 +94,34 @@ cPluginSkinEnigma::~cPluginSkinEnigma() const char *cPluginSkinEnigma::CommandLineHelp(void) { // return a string that describes all known command line options. - return " -l <LOGODIR>, --logodir=<LOGODIR> Define a directory for channel logos.\n"; + return " -i <IMAGESDIR>, --epgimages=<IMAGESDIR> Set directory where epgimages are stored\n" + " -l <LOGODIR>, --logodir=<LOGODIR> Set directory where logos are stored.\n"; } bool cPluginSkinEnigma::ProcessArgs(int argc, char *argv[]) { // implement command line argument processing here if applicable. - static const struct option long_options[] = { - { "logodir", required_argument, NULL, 'l' }, - { NULL } - }; - - int c; - while ((c = getopt_long(argc, argv, "l:", long_options, NULL)) != -1) { - switch (c) { - case 'l': - EnigmaConfig.SetLogoDir(optarg); - fLogodirSet = true; - break; - default: - return false; - } - } + static const struct option long_options[] = { + { "logodir", required_argument, NULL, 'l' }, + { "epgimages", required_argument, NULL, 'i' }, + { NULL } + }; + + int c; + while ((c = getopt_long(argc, argv, "l:i:", long_options, NULL)) != -1) { + switch (c) { + case 'i': + EnigmaConfig.SetImagesDir(optarg); + fImagesDirSet = true; + break; + case 'l': + EnigmaConfig.SetLogoDir(optarg); + fLogodirSet = true; + break; + default: + return false; + } + } return true; } @@ -124,11 +137,21 @@ bool cPluginSkinEnigma::Start(void) // start any background activities the plugin shall perform. debug("cPluginSkinEnigma::Start()\n"); RegisterI18n(Phrases); - if (!fLogodirSet) { - // set logo directory - EnigmaConfig.SetLogoDir(cPlugin::ConfigDirectory(PLUGIN_NAME_I18N)); - fLogodirSet = true; - } + if (!fLogodirSet) { + // set logo directory + EnigmaConfig.SetLogoDir(cPlugin::ConfigDirectory(PLUGIN_NAME_I18N)); + fLogodirSet = true; + } + if (!fImagesDirSet) { + // set epgimages directory + char *dir = NULL; + asprintf(&dir, "%s/epgimages", cPlugin::ConfigDirectory(PLUGIN_NAME_I18N)); + if (dir) { + EnigmaConfig.SetImagesDir(dir); + fImagesDirSet = true; + free(dir); + } + } // resize logo cache EnigmaLogoCache.Resize(EnigmaConfig.cacheSize); // create skin @@ -198,6 +221,22 @@ bool cPluginSkinEnigma::SetupParse(const char *Name, const char *Value) EnigmaConfig.useSubtitleRerun = atoi(Value); else if (!strcasecmp(Name, "ShowTimerConflicts")) EnigmaConfig.showTimerConflicts = atoi(Value); + else if (!strcasecmp(Name, "ShowRecSize")) + EnigmaConfig.showRecSize = atoi(Value); + else if (!strcasecmp(Name, "ShowImages")) + EnigmaConfig.showImages = atoi(Value); + else if (!strcasecmp(Name, "ResizeImages")) + EnigmaConfig.resizeImages = atoi(Value); + else if (!strcasecmp(Name, "ShowMailIcon")) + EnigmaConfig.showMailIcon = atoi(Value); + else if (!strcasecmp(Name, "ImageWidth")) + EnigmaConfig.imageWidth = atoi(Value); + else if (!strcasecmp(Name, "ImageHeight")) + EnigmaConfig.imageHeight = atoi(Value); + else if (!strcasecmp(Name, "ImageExtension")) + EnigmaConfig.imageExtension = atoi(Value); + else if (!strcasecmp(Name, "FullTitleWidth")) + EnigmaConfig.fullTitleWidth = atoi(Value); else return false; @@ -234,13 +273,15 @@ cPluginSkinEnigmaSetup::cPluginSkinEnigmaSetup(void) void cPluginSkinEnigmaSetup::AddCategory(const char *Title) { char *buffer = NULL; - asprintf(&buffer, "--- %s ----------------------------------------------------------------", Title ); + asprintf(&buffer, "--- %s ----------------------------------------------------------------------------------", Title ); cOsdItem *item = new cOsdItem(buffer); free(buffer); - item->SetSelectable(false); - Add(item); + if (item) { + item->SetSelectable(false); + Add(item); + } } void cPluginSkinEnigmaSetup::Setup(void) @@ -252,8 +293,13 @@ void cPluginSkinEnigmaSetup::Setup(void) showSymbolsTexts[0] = tr("never"); showSymbolsTexts[1] = tr("always"); +#ifndef SKINENIGMA_NO_MENULOGO +#define NUM_SHOWSYMBOLSTEXTS 4 showSymbolsTexts[2] = tr("not in menu"); showSymbolsTexts[3] = tr("only in menu"); +#else +#define NUM_SHOWSYMBOLSTEXTS 2 +#endif showRemainingTexts[0] = tr("elapsed"); showRemainingTexts[1] = tr("remaining"); @@ -263,16 +309,36 @@ void cPluginSkinEnigmaSetup::Setup(void) useSubtitleRerunTexts[1] = tr("if exists"); useSubtitleRerunTexts[2] = tr("always"); + showRecSizeTexts[0] = tr("never"); + showRecSizeTexts[1] = tr("use size.vdr only"); + showRecSizeTexts[2] = tr("always"); + +#ifndef SKINENIGMA_NO_MENULOGO + resizeImagesTexts[0] = tr("pixel algo"); + resizeImagesTexts[1] = tr("ratio algo"); + resizeImagesTexts[2] = tr("zoom image"); +#endif + +#ifdef USE_PLUGIN_MAILBOX + showMailIconTexts[0] = tr("never"); + showMailIconTexts[1] = tr("only if new mail present"); + showMailIconTexts[2] = tr("always"); +#endif + Add(new cMenuEditBoolItem(tr("One area (if possible)"), &data.singleArea, tr("no"), tr("yes"))); - if (data.singleArea) { - Add(new cMenuEditBoolItem(tr("Bpp in single area"), &data.singleArea8Bpp, + if (data.singleArea) { + Add(new cMenuEditBoolItem(tr("Bpp in single area"), &data.singleArea8Bpp, "4", "8")); - } + } Add(new cMenuEditBoolItem(tr("Show info area in main menu"), &data.showInfo, tr("no"), tr("yes"))); Add(new cMenuEditBoolItem(tr("Show auxiliary information"), &data.showAuxInfo, tr("top"), tr("bottom"))); + Add(new cMenuEditStraItem(tr("Show recording's size"), &data.showRecSize, + 3, showRecSizeTexts)); + Add(new cMenuEditBoolItem(tr("Full title width"), &data.fullTitleWidth, + tr("no"), tr("yes"))); Add(new cMenuEditStraItem(tr("Show remaining/elapsed time"), &data.showRemaining, 3, showRemainingTexts)); Add(new cMenuEditBoolItem(tr("Show VPS"), &data.showVps, @@ -281,24 +347,59 @@ void cPluginSkinEnigmaSetup::Setup(void) tr("no"), tr("yes"))); AddCategory(tr("Logos & Symbols")); - Add(new cMenuEditStraItem(tr("Show symbols"), &data.showSymbols, - 4, showSymbolsTexts)); + if (!data.singleArea || data.singleArea8Bpp) { + Add(new cMenuEditStraItem(tr("Show symbols"), &data.showSymbols, + NUM_SHOWSYMBOLSTEXTS, showSymbolsTexts)); + } Add(new cMenuEditBoolItem(tr("Show symbols in lists"), &data.showListSymbols, tr("no"), tr("yes"))); Add(new cMenuEditBoolItem(tr("Show marker in lists"), &data.showMarker, tr("no"), tr("yes"))); - Add(new cMenuEditBoolItem(tr("Show flags"), &data.showFlags, - tr("no"), tr("yes"))); - Add(new cMenuEditBoolItem(tr("Show channel logos"), &data.showLogo, - tr("no"), tr("yes"))); + if (!data.singleArea || data.singleArea8Bpp) { + Add(new cMenuEditBoolItem(tr("Show flags"), &data.showFlags, + tr("no"), tr("yes"))); + } - if (data.showLogo) { - Add(new cMenuEditBoolItem(tr("Identify channel by"), &data.useChannelId, - tr("name"), tr("data"))); +#ifdef USE_PLUGIN_MAILBOX + cPlugin *MailBoxPlugin = cPluginManager::GetPlugin("mailbox"); + if (MailBoxPlugin && MailBoxPlugin->Service("MailBox-HasNewMail-1.0", 0)) { + Add(new cMenuEditStraItem(tr("Show mail icon"), &data.showMailIcon, + 3, showMailIconTexts)); + } +#endif + +#ifndef SKINENIGMA_NO_MENULOGO + if ((!data.singleArea || data.singleArea8Bpp) && (data.showSymbols == 1 || data.showSymbols == 3)) { + Add(new cMenuEditBoolItem(tr("Show event/recording images"), &data.showImages, + tr("no"), tr("yes"))); + if (data.showImages) { +#ifdef HAVE_IMAGEMAGICK + Add(new cMenuEditStraItem(tr("Resize images"), &data.resizeImages, + 3, resizeImagesTexts)); +#endif + Add(new cMenuEditIntItem(tr("Image width" ), &data.imageWidth, + 80, 180)); + Add(new cMenuEditIntItem(tr("Image height" ), &data.imageHeight, + 80, 144)); +#ifdef HAVE_IMAGEMAGICK + Add(new cMenuEditStraItem(tr("Image format"), &data.imageExtension, + 3, imageExtensionTexts)); +#endif + } } - if (data.showLogo || data.showSymbols) { - Add(new cMenuEditIntItem(tr("Channel logo cache size"), &data.cacheSize, - 0, 1000)); +#endif //SKINENIGMA_NO_MENULOGO + + if (!data.singleArea || data.singleArea8Bpp) { + Add(new cMenuEditBoolItem(tr("Show channel logos"), &data.showLogo, + tr("no"), tr("yes"))); + if (data.showLogo) { + Add(new cMenuEditBoolItem(tr("Identify channel by"), &data.useChannelId, + tr("name"), tr("data"))); + } + if (data.showLogo || data.showSymbols) { + Add(new cMenuEditIntItem(tr("Channel logo cache size"), &data.cacheSize, + 0, 1000)); + } } #ifdef SKINENIGMA_HAVE_EPGSEARCH @@ -339,6 +440,14 @@ void cPluginSkinEnigmaSetup::Store(void) SetupStore("NumReruns", EnigmaConfig.numReruns); SetupStore("UseSubtitleRerun", EnigmaConfig.useSubtitleRerun); SetupStore("ShowTimerConflicts", EnigmaConfig.showTimerConflicts); + SetupStore("ShowRecSize", EnigmaConfig.showRecSize); + SetupStore("ShowImages", EnigmaConfig.showImages); + SetupStore("ResizeImages", EnigmaConfig.resizeImages); + SetupStore("ShowMailIcon", EnigmaConfig.showMailIcon); + SetupStore("ImageWidth", EnigmaConfig.imageWidth); + SetupStore("ImageHeight", EnigmaConfig.imageHeight); + SetupStore("ImageExtension", EnigmaConfig.imageExtension); + SetupStore("FullTitleWidth", EnigmaConfig.fullTitleWidth); // resize logo cache EnigmaLogoCache.Resize(EnigmaConfig.cacheSize); } @@ -348,8 +457,10 @@ eOSState cPluginSkinEnigmaSetup::ProcessKey(eKeys Key) // process key presses int oldShowLogo = data.showLogo; int oldShowSymbols = data.showSymbols; - int oldSingleArea = data.singleArea; + int oldSingleArea = data.singleArea; + int oldSingleArea8Bpp = data.singleArea8Bpp; int oldShowInfo = data.showInfo; + int oldShowImages = data.showImages; eOSState state = cMenuSetupPage::ProcessKey(Key); if ((state == osUnknown) && (Key == kRed)) { @@ -358,7 +469,14 @@ eOSState cPluginSkinEnigmaSetup::ProcessKey(eKeys Key) Skins.Message(mtInfo, NULL); state = osContinue; } - if (Key != kNone && ((data.singleArea != oldSingleArea) || (data.showLogo != oldShowLogo) || (data.showSymbols != oldShowSymbols) || (oldShowInfo != data.showInfo))) { + if (Key != kNone && + ((data.singleArea != oldSingleArea) + || (data.singleArea8Bpp != oldSingleArea8Bpp) + || (data.showLogo != oldShowLogo) + || (data.showSymbols != oldShowSymbols) + || (oldShowInfo != data.showInfo) + || (oldShowImages != data.showImages) + )) { Setup(); } @@ -366,3 +484,4 @@ eOSState cPluginSkinEnigmaSetup::ProcessKey(eKeys Key) } VDRPLUGINCREATOR(cPluginSkinEnigma); // don't touch this! +// vim:et:sw=2:ts=2: |