2014-09-27 09:25:14 +02:00
|
|
|
#ifndef __NOPACITY_IMAGECACHE_H
|
|
|
|
#define __NOPACITY_IMAGECACHE_H
|
|
|
|
|
|
|
|
#define X_DISPLAY_MISSING
|
|
|
|
|
|
|
|
#include <vdr/osd.h>
|
|
|
|
#include <vdr/skins.h>
|
|
|
|
#include <vector>
|
2014-10-30 16:41:06 +01:00
|
|
|
#include "imageloader.h"
|
2014-09-27 09:25:14 +02:00
|
|
|
#include "../libtemplate/templatefunction.h"
|
|
|
|
|
2014-10-30 16:41:06 +01:00
|
|
|
class cImageCache : public cImageLoader {
|
2014-09-27 09:25:14 +02:00
|
|
|
public:
|
|
|
|
cImageCache();
|
|
|
|
~cImageCache();
|
|
|
|
void Lock(void) { mutex.Lock(); }
|
|
|
|
void Unlock(void) { mutex.Unlock(); }
|
2014-10-03 15:54:23 +02:00
|
|
|
void SetPathes(void);
|
2014-09-27 09:25:14 +02:00
|
|
|
//channel logos
|
|
|
|
void CacheLogo(int width, int height);
|
|
|
|
cImage *GetLogo(string channelID, int width, int height);
|
|
|
|
bool LogoExists(string channelID);
|
|
|
|
cImage *GetSeparatorLogo(string name, int width, int height);
|
|
|
|
bool SeparatorLogoExists(string name);
|
|
|
|
//icons
|
|
|
|
void CacheIcon(eImageType type, string path, int width, int height);
|
|
|
|
cImage *GetIcon(eImageType type, string name, int width, int height);
|
2015-04-05 16:56:15 +02:00
|
|
|
string GetIconName(string label, eMenuCategory cat = mcUndefined, string plugName = "");
|
2014-11-15 15:49:48 +01:00
|
|
|
bool MenuIconExists(string name);
|
2014-09-27 09:25:14 +02:00
|
|
|
//skinparts
|
|
|
|
void CacheSkinpart(string path, int width, int height);
|
|
|
|
cImage *GetSkinpart(string name, int width, int height);
|
2015-03-12 17:28:35 +01:00
|
|
|
//cairo special images
|
2015-03-31 06:57:02 +02:00
|
|
|
cImage *GetVerticalText(string text, tColor color, string font, int size, int direction);
|
2014-09-27 09:25:14 +02:00
|
|
|
//helpers
|
|
|
|
void Clear(void);
|
|
|
|
void Debug(bool full);
|
|
|
|
void GetIconCacheSize(int &num, int &size);
|
|
|
|
void GetLogoCacheSize(int &num, int &size);
|
|
|
|
void GetSkinpartsCacheSize(int &num, int &size);
|
|
|
|
private:
|
|
|
|
static cMutex mutex;
|
|
|
|
static string items[16];
|
|
|
|
cImage *tempStaticLogo;
|
2014-10-03 15:54:23 +02:00
|
|
|
string logoPath;
|
2015-01-25 11:48:30 +01:00
|
|
|
string iconPathSkin;
|
|
|
|
string skinPartsPathSkin;
|
|
|
|
string iconPathTheme;
|
|
|
|
string skinPartsPathTheme;
|
2014-09-27 09:25:14 +02:00
|
|
|
map<string, cImage*> iconCache;
|
|
|
|
map<string, cImage*> channelLogoCache;
|
|
|
|
map<string, cImage*> skinPartsCache;
|
2015-03-12 17:28:35 +01:00
|
|
|
map<string, cImage*> cairoImageCache;
|
2014-09-27 09:25:14 +02:00
|
|
|
bool LoadIcon(eImageType type, string name);
|
|
|
|
bool LoadLogo(const cChannel *channel);
|
|
|
|
bool LoadSeparatorLogo(string name);
|
|
|
|
bool LoadSkinpart(string name);
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif //__NOPACITY_IMAGECACHE_H
|