summaryrefslogtreecommitdiff
path: root/logo.c
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 /logo.c
parentc562d549bc6274265991eec634f99b1e311323df (diff)
downloadvdr-plugin-skinenigmang-0.0.5rc.tar.gz
vdr-plugin-skinenigmang-0.0.5rc.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 'logo.c')
-rw-r--r--logo.c44
1 files changed, 22 insertions, 22 deletions
diff --git a/logo.c b/logo.c
index 30a0cbe..69d5eb5 100644
--- a/logo.c
+++ b/logo.c
@@ -1,17 +1,15 @@
/*
- * logo.c: The 'EnigmaNG' VDR skin
+ * logo.c: 'EnigmaNG' skin for the Video Disk Recorder
*
* See the README file for copyright information and how to reach the author.
*
*/
-#include <strings.h>
-
-#include "bitmap.h"
#include "common.h"
+#include "bitmap.h"
#include "config.h"
#include "logo.h"
-#include <vdr/tools.h>
+
#include <vdr/plugin.h>
cEnigmaLogoCache EnigmaLogoCache(0);
@@ -45,32 +43,35 @@ bool cEnigmaLogoCache::Resize(unsigned int cacheSizeP)
return true;
}
-bool cEnigmaLogoCache::LoadEventImage(const cEvent *Event, int w, int h, int c)
+bool cEnigmaLogoCache::DrawEventImage(const cEvent *Event, int x, int y, int w, int h, int c, cBitmap *bmp)
{
- if (Event == NULL)
+ if (Event == NULL || bmp == NULL)
return false;
char *strFilename = NULL;
asprintf(&strFilename, "%s/%d.%s", EnigmaConfig.GetImagesDir(), Event->EventID(), EnigmaConfig.GetImageExtension());
- int rc = LoadImage(strFilename, w, h, c);
+ int rc = DrawImage(strFilename, x, y, w, h, c, bmp);
free (strFilename);
return rc;
}
-bool cEnigmaLogoCache::LoadRecordingImage(const cRecording *Recording, int w, int h, int c)
+bool cEnigmaLogoCache::DrawRecordingImage(const cRecording *Recording, int x, int y, int w, int h, int c, cBitmap *bmp)
{
- if (Recording == NULL)
+ if (Recording == NULL || bmp == NULL)
return false;
char *strFilename = NULL;
asprintf(&strFilename, "%s/%s.%s", Recording->FileName(), RECORDING_COVER, EnigmaConfig.GetImageExtension());
- int rc = LoadImage(strFilename, w, h, c);
+ int rc = DrawImage(strFilename, x, y, w, h, c, bmp);
free (strFilename);
return rc;
}
-bool cEnigmaLogoCache::LoadImage(const char *fileNameP, int w, int h, int c)
+bool cEnigmaLogoCache::DrawImage(const char *fileNameP, int x, int y, int w, int h, int c, cBitmap *bmp)
{
+ if (fileNameP== NULL || bmp == NULL)
+ return false;
+
struct stat stbuf;
if (lstat(fileNameP, &stbuf) != 0) {
error("cPluginSkinEnigma::LoadImage(%s) FILE NOT FOUND\n", fileNameP);
@@ -79,11 +80,13 @@ bool cEnigmaLogoCache::LoadImage(const char *fileNameP, int w, int h, int c)
}
#ifdef HAVE_IMAGEMAGICK
- int rc = image.LoadImage(fileNameP, w, h, c, *bmpImage);
- bitmapM = rc ? bmpImage : NULL;
- return rc;
+ bitmapM = NULL;
+ return image.DrawImage(fileNameP, x, y, w, h, c, bmp);
#else
- return LoadXpm(fileNameP, w, h);
+ int rc = LoadXpm(fileNameP, w, h);
+ if (rc)
+ bmp->DrawBitmap(x, y, *bitmapM); //TODO?
+ return rc;
#endif
}
@@ -226,13 +229,10 @@ bool cEnigmaLogoCache::Flush(void)
if (!cacheMapM.empty()) {
debug("cPluginSkinEnigma::Flush() NON-EMPTY\n");
// delete bitmaps and clear map
- for (std::map < std::string, cBitmap * >::iterator i = cacheMapM.begin();
- i != cacheMapM.end(); ++i) {
- cBitmap *bmp = i->second;
- if (bmp)
- DELETENULL(bmp);
- cacheMapM.erase(i);
+ for (std::map<std::string, cBitmap *>::iterator i = cacheMapM.begin(); i != cacheMapM.end(); i++) {
+ delete((*i).second);
}
+ cacheMapM.clear();
// nullify bitmap pointer
bitmapM = NULL;
}