mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-09-01 18:01:13 +02:00
framebuffer_ng: port framebuffer features
port over1ee458e4
anda4fdd174
to framebuffer_ng
This commit is contained in:
@@ -59,6 +59,7 @@ extern int gfxfd;
|
|||||||
|
|
||||||
extern CPictureViewer * g_PicViewer;
|
extern CPictureViewer * g_PicViewer;
|
||||||
#define ICON_CACHE_SIZE 1024*1024*2 // 2mb
|
#define ICON_CACHE_SIZE 1024*1024*2 // 2mb
|
||||||
|
#define ICONDIR_VAR "/var/tuxbox/icons/"
|
||||||
|
|
||||||
#define BACKGROUNDIMAGEWIDTH 720
|
#define BACKGROUNDIMAGEWIDTH 720
|
||||||
|
|
||||||
@@ -809,7 +810,13 @@ bool CFrameBuffer::paintIcon(const std::string & filename, const int x, const in
|
|||||||
/* we cache and check original name */
|
/* we cache and check original name */
|
||||||
it = icon_cache.find(filename);
|
it = icon_cache.find(filename);
|
||||||
if(it == icon_cache.end()) {
|
if(it == icon_cache.end()) {
|
||||||
std::string newname = iconBasePath + filename.c_str() + ".png";
|
std::string newname = filename;
|
||||||
|
/* if it is not an absolute path, search in configured paths */
|
||||||
|
if (filename.find("/", 0) == std::string::npos) {
|
||||||
|
newname = ICONDIR_VAR + filename + ".png";
|
||||||
|
if (access(newname.c_str(), F_OK))
|
||||||
|
newname = iconBasePath + filename + ".png";
|
||||||
|
}
|
||||||
//printf("CFrameBuffer::paintIcon: check for %s\n", newname.c_str());fflush(stdout);
|
//printf("CFrameBuffer::paintIcon: check for %s\n", newname.c_str());fflush(stdout);
|
||||||
|
|
||||||
data = g_PicViewer->getIcon(newname, &width, &height);
|
data = g_PicViewer->getIcon(newname, &width, &height);
|
||||||
@@ -828,7 +835,9 @@ bool CFrameBuffer::paintIcon(const std::string & filename, const int x, const in
|
|||||||
goto _display;
|
goto _display;
|
||||||
}
|
}
|
||||||
|
|
||||||
newname = iconBasePath + filename.c_str() + ".raw";
|
newname = ICONDIR_VAR + filename + ".raw";
|
||||||
|
if (access(newname.c_str(), F_OK))
|
||||||
|
newname = iconBasePath + filename + ".raw";
|
||||||
|
|
||||||
lfd = open(newname.c_str(), O_RDONLY);
|
lfd = open(newname.c_str(), O_RDONLY);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user