summaryrefslogtreecommitdiff
path: root/styledpixmap.c
diff options
context:
space:
mode:
authorlouis <louis.braun@gmx.de>2013-12-21 11:25:03 +0100
committerlouis <louis.braun@gmx.de>2013-12-21 11:25:03 +0100
commit4c61104675de5f1fac7e7fa95fb5743e18defc02 (patch)
tree7a3ee90e3b28246e8d4595954d4559445fb7ebe7 /styledpixmap.c
parent8aa2c81d3165a0517115337362f1203ea4bdd899 (diff)
downloadvdr-plugin-tvguide-4c61104675de5f1fac7e7fa95fb5743e18defc02.tar.gz
vdr-plugin-tvguide-4c61104675de5f1fac7e7fa95fb5743e18defc02.tar.bz2
Version 1.2.0pre
Diffstat (limited to 'styledpixmap.c')
-rw-r--r--styledpixmap.c66
1 files changed, 64 insertions, 2 deletions
diff --git a/styledpixmap.c b/styledpixmap.c
index 6acc1d0..41bdf28 100644
--- a/styledpixmap.c
+++ b/styledpixmap.c
@@ -1,4 +1,5 @@
#include "imageloader.h"
+#include "geometrymanager.h"
#include "styledpixmap.h"
cStyledPixmap::cStyledPixmap(void) {
@@ -21,15 +22,76 @@ void cStyledPixmap::setPixmap(cPixmap *pixmap) {
}
void cStyledPixmap::drawBackground() {
- if (tvguideConfig.useBlending == 1){
+ if (tvguideConfig.style == eStyleBlendingDefault){
drawBlendedBackground();
- } else if (tvguideConfig.useBlending == 2){
+ } else if (tvguideConfig.style == eStyleBlendingMagick){
drawSparsedBackground();
} else {
pixmap->Fill(color);
}
}
+void cStyledPixmap::drawBackgroundGraphical(eBackgroundType type, bool active) {
+ cImage *back = NULL;
+ if (type == bgGrid) {
+ back = imgCache.GetGrid(pixmap->ViewPort().Width(), pixmap->ViewPort().Height(), active);
+ } else if (type == bgChannelHeader) {
+ back = imgCache.GetOsdElement(oeLogoBack);
+ } else if (type == bgChannelGroup) {
+ back = imgCache.GetChannelGroup(pixmap->ViewPort().Width(), pixmap->ViewPort().Height());
+ } else if (type == bgStatusHeaderWindowed) {
+ back = imgCache.GetOsdElement(oeStatusHeaderContentWindowed);
+ } else if (type == bgStatusHeaderFull) {
+ back = imgCache.GetOsdElement(oeStatusHeaderContentFull);
+ } else if (type == bgClock) {
+ back = imgCache.GetOsdElement(oeClock);
+ } else if (type == bgEpgHeader) {
+ back = imgCache.GetOsdElement(oeEpgHeader);
+ } else if (type == bgButton) {
+ drawBackgroundButton(active);
+ return;
+ } else if (type == bgRecMenuBack) {
+ cImageLoader imgLoader;
+ if (imgLoader.LoadOsdElement("recmenu_background", pixmap->ViewPort().Width(), pixmap->ViewPort().Height())) {
+ cImage background = imgLoader.GetImage();
+ pixmap->DrawImage(cPoint(0, 0), background);
+ } else {
+ pixmap->Fill(clrTransparent);
+ }
+ return;
+ }
+ if (back) {
+ pixmap->DrawImage(cPoint(0,0), *back);
+ } else {
+ pixmap->Fill(clrTransparent);
+ }
+}
+
+void cStyledPixmap::drawBackgroundButton(bool active) {
+ std::string buttonName = "";
+ int buttonWidth = pixmap->ViewPort().Width();
+ int buttonHeight = pixmap->ViewPort().Height();
+ if (buttonWidth > geoManager.osdWidth * 50 / 100) {
+ if (active)
+ buttonName = "button_active_70percent";
+ else
+ buttonName = "button_70percent";
+ } else {
+ if (active)
+ buttonName = "button_active_30percent";
+ else
+ buttonName = "button_30percent";
+ }
+ cImageLoader imgLoader;
+ if (imgLoader.LoadOsdElement(buttonName.c_str(), buttonWidth, buttonHeight)) {
+ cImage button = imgLoader.GetImage();
+ pixmap->DrawImage(cPoint(0, 0), button);
+ } else {
+ pixmap->Fill(clrTransparent);
+ }
+}
+
+
void cStyledPixmap::drawBlendedBackground() {
int width = pixmap->ViewPort().Width();
int height = pixmap->ViewPort().Height();