vdr-plugin-tvguide/osdmanager.c

36 lines
1.2 KiB
C
Raw Normal View History

2013-12-07 15:51:50 +01:00
#include "config.h"
#include "osdmanager.h"
2013-01-17 13:16:44 +01:00
cOsdManager::cOsdManager(void) {
}
bool cOsdManager::setOsd() {
2013-05-26 11:38:05 +02:00
osd = cOsdProvider::NewOsd(cOsd::OsdLeft(), cOsd::OsdTop());
if (osd) {
tArea Area = { 0, 0, cOsd::OsdWidth(), cOsd::OsdHeight(), 32 };
if (osd->SetAreas(&Area, 1) == oeOk) {
return true;
}
}
return false;
2013-01-17 13:16:44 +01:00
}
void cOsdManager::setBackground() {
if (tvguideConfig.displayStatusHeader && tvguideConfig.scaleVideo) {
2013-12-21 11:25:03 +01:00
int widthStatus = cOsd::OsdWidth() - geoManager.statusHeaderHeight * 16 / 9;
osd->DrawRectangle(0, 0, widthStatus, geoManager.statusHeaderHeight, theme.Color(clrBackgroundOSD));
osd->DrawRectangle(0, geoManager.statusHeaderHeight, Width(), Height(), theme.Color(clrBackgroundOSD));
}
else
2013-05-26 16:54:22 +02:00
osd->DrawRectangle(0, 0, Width(), Height(), theme.Color(clrBackgroundOSD));
2013-01-17 13:16:44 +01:00
}
cPixmap *cOsdManager::requestPixmap(int Layer, const cRect &ViewPort, const cRect &DrawPort) {
2013-05-26 11:38:05 +02:00
return osd->CreatePixmap(Layer, ViewPort, DrawPort);
}
2013-01-17 13:16:44 +01:00
void cOsdManager::releasePixmap(cPixmap *pixmap) {
if (!pixmap)
return;
2013-05-26 11:38:05 +02:00
osd->DestroyPixmap(pixmap);
2013-01-17 13:16:44 +01:00
}