vdr-plugin-tvguide/osdmanager.c

39 lines
1.1 KiB
C
Raw Normal View History

2019-07-11 11:07:13 +02:00
#include "config.h"
#include "osdmanager.h"
cOsdManager::cOsdManager(void) {
}
bool cOsdManager::setOsd() {
osd = cOsdProvider::NewOsd(cOsd::OsdLeft(), cOsd::OsdTop());
if (osd) {
2020-03-11 14:58:42 +01:00
tArea Area = { 0, 0, cOsd::OsdWidth() - 1, cOsd::OsdHeight() - 1, 32 };
2019-07-11 11:07:13 +02:00
if (osd->SetAreas(&Area, 1) == oeOk) {
return true;
}
}
return false;
}
void cOsdManager::setBackground() {
2019-07-11 11:28:11 +02:00
if (config.displayStatusHeader && config.scaleVideo) {
2019-07-11 11:07:13 +02: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
osd->DrawRectangle(0, 0, Width(), Height(), theme.Color(clrBackgroundOSD));
}
cPixmap *cOsdManager::requestPixmap(int Layer, const cRect &ViewPort, const cRect &DrawPort) {
return osd->CreatePixmap(Layer, ViewPort, DrawPort);
}
void cOsdManager::releasePixmap(cPixmap *pixmap) {
if (!pixmap)
return;
osd->DestroyPixmap(pixmap);
}