summaryrefslogtreecommitdiff
path: root/styledpixmap.c
diff options
context:
space:
mode:
authorlouis <louis.braun@gmx.de>2013-05-26 11:38:05 +0200
committerlouis <louis.braun@gmx.de>2013-05-26 11:38:05 +0200
commit812fd1b7a5aeb67d4139255a6df8230c420ea57e (patch)
tree36e0408bf9f4191b37cf11bd9dd01e381d105f6e /styledpixmap.c
parent9f47ab764efc83d8bf94f25c4badeb6e4c91c649 (diff)
downloadvdr-plugin-tvguide-812fd1b7a5aeb67d4139255a6df8230c420ea57e.tar.gz
vdr-plugin-tvguide-812fd1b7a5aeb67d4139255a6df8230c420ea57e.tar.bz2
whitespace cleanup
Diffstat (limited to 'styledpixmap.c')
-rw-r--r--styledpixmap.c156
1 files changed, 78 insertions, 78 deletions
diff --git a/styledpixmap.c b/styledpixmap.c
index 041cf88..77e6450 100644
--- a/styledpixmap.c
+++ b/styledpixmap.c
@@ -1,60 +1,60 @@
#include "styledpixmap.h"
cStyledPixmap::cStyledPixmap(void) {
- pixmap = NULL;
+ pixmap = NULL;
}
cStyledPixmap::cStyledPixmap(cPixmap *pixmap) {
- this->pixmap = pixmap;
+ this->pixmap = pixmap;
}
cStyledPixmap::~cStyledPixmap(void) {
- if (pixmap)
- osdManager.releasePixmap(pixmap);
+ if (pixmap)
+ osdManager.releasePixmap(pixmap);
}
void cStyledPixmap::setPixmap(cPixmap *pixmap) {
- if (pixmap) {
- this->pixmap = pixmap;
- }
+ if (pixmap) {
+ this->pixmap = pixmap;
+ }
}
void cStyledPixmap::drawBackground() {
if (tvguideConfig.useBlending == 1){
- drawBlendedBackground();
- } else if (tvguideConfig.useBlending == 2){
- drawSparsedBackground();
- } else {
+ drawBlendedBackground();
+ } else if (tvguideConfig.useBlending == 2){
+ drawSparsedBackground();
+ } else {
pixmap->Fill(color);
}
}
void cStyledPixmap::drawBlendedBackground() {
- int width = pixmap->ViewPort().Width();
- int height = pixmap->ViewPort().Height();
- pixmap->Fill(color);
- int numSteps = 64;
- int alphaStep = 0x04;
- if (height < 30)
- return;
- else if (height < 100) {
- numSteps = 32;
- alphaStep = 0x08;
- }
- int stepY = 0.5*height / numSteps;
- if (stepY == 0) stepY = 1;
- int alpha = 0x00;
- tColor clr;
- for (int i = 0; i<numSteps; i++) {
- clr = AlphaBlend(color, colorBlending, alpha);
- pixmap->DrawRectangle(cRect(0,i*stepY,width,stepY), clr);
- alpha += alphaStep;
- }
+ int width = pixmap->ViewPort().Width();
+ int height = pixmap->ViewPort().Height();
+ pixmap->Fill(color);
+ int numSteps = 64;
+ int alphaStep = 0x04;
+ if (height < 30)
+ return;
+ else if (height < 100) {
+ numSteps = 32;
+ alphaStep = 0x08;
+ }
+ int stepY = 0.5*height / numSteps;
+ if (stepY == 0) stepY = 1;
+ int alpha = 0x00;
+ tColor clr;
+ for (int i = 0; i<numSteps; i++) {
+ clr = AlphaBlend(color, colorBlending, alpha);
+ pixmap->DrawRectangle(cRect(0,i*stepY,width,stepY), clr);
+ alpha += alphaStep;
+ }
}
void cStyledPixmap::drawSparsedBackground() {
- int width = pixmap->ViewPort().Width();
- int height = pixmap->ViewPort().Height();
+ int width = pixmap->ViewPort().Width();
+ int height = pixmap->ViewPort().Height();
cImageLoader imgLoader;
if (imgLoader.DrawBackground(colorBlending, color, width, height))
pixmap->DrawImage(cPoint(0,0), imgLoader.GetImage());
@@ -62,73 +62,73 @@ void cStyledPixmap::drawSparsedBackground() {
}
void cStyledPixmap::drawBorder() {
- int width = pixmap->ViewPort().Width();
- int height = pixmap->ViewPort().Height();
-
- drawDefaultBorder(width, height);
- if (tvguideConfig.roundedCorners) {
- int borderRadius = 12;
- drawRoundedCorners(width, height, borderRadius);
- }
+ int width = pixmap->ViewPort().Width();
+ int height = pixmap->ViewPort().Height();
+
+ drawDefaultBorder(width, height);
+ if (tvguideConfig.roundedCorners) {
+ int borderRadius = 12;
+ drawRoundedCorners(width, height, borderRadius);
+ }
}
void cStyledPixmap::drawDefaultBorder(int width, int height) {
- pixmap->DrawRectangle(cRect(0,0,width,2), theme.Color(clrBackground)); //top
- pixmap->DrawRectangle(cRect(0,0,2,height), theme.Color(clrBackground)); //left
- pixmap->DrawRectangle(cRect(0,height-2,width,2), theme.Color(clrBackground)); //bottom
- pixmap->DrawRectangle(cRect(width-2,0,2,height), theme.Color(clrBackground)); //right
-
- pixmap->DrawRectangle(cRect(2,2,width-4,1), theme.Color(clrBorder)); //top
- pixmap->DrawRectangle(cRect(2,2,1,height-4), theme.Color(clrBorder)); //left
- pixmap->DrawRectangle(cRect(2,height-3,width-4,1), theme.Color(clrBorder)); //bottom
- pixmap->DrawRectangle(cRect(width-3,2,1,height-4), theme.Color(clrBorder)); //right
+ pixmap->DrawRectangle(cRect(0,0,width,2), theme.Color(clrBackground)); //top
+ pixmap->DrawRectangle(cRect(0,0,2,height), theme.Color(clrBackground)); //left
+ pixmap->DrawRectangle(cRect(0,height-2,width,2), theme.Color(clrBackground)); //bottom
+ pixmap->DrawRectangle(cRect(width-2,0,2,height), theme.Color(clrBackground)); //right
+
+ pixmap->DrawRectangle(cRect(2,2,width-4,1), theme.Color(clrBorder)); //top
+ pixmap->DrawRectangle(cRect(2,2,1,height-4), theme.Color(clrBorder)); //left
+ pixmap->DrawRectangle(cRect(2,height-3,width-4,1), theme.Color(clrBorder)); //bottom
+ pixmap->DrawRectangle(cRect(width-3,2,1,height-4), theme.Color(clrBorder)); //right
}
void cStyledPixmap::drawBoldBorder() {
- int width = pixmap->ViewPort().Width();
- int height = pixmap->ViewPort().Height();
- pixmap->DrawRectangle(cRect(0,0,width,2), theme.Color(clrBorder)); //top
- pixmap->DrawRectangle(cRect(0,0,2,height), theme.Color(clrBorder)); //left
- pixmap->DrawRectangle(cRect(0,height-2,width,2), theme.Color(clrBorder)); //bottom
- pixmap->DrawRectangle(cRect(width-2,0,2,height), theme.Color(clrBorder)); //right
+ int width = pixmap->ViewPort().Width();
+ int height = pixmap->ViewPort().Height();
+ pixmap->DrawRectangle(cRect(0,0,width,2), theme.Color(clrBorder)); //top
+ pixmap->DrawRectangle(cRect(0,0,2,height), theme.Color(clrBorder)); //left
+ pixmap->DrawRectangle(cRect(0,height-2,width,2), theme.Color(clrBorder)); //bottom
+ pixmap->DrawRectangle(cRect(width-2,0,2,height), theme.Color(clrBorder)); //right
}
void cStyledPixmap::drawRoundedCorners(int width, int height, int radius) {
- pixmap->DrawEllipse(cRect(2,2,radius,radius), theme.Color(clrBorder), -2);
- pixmap->DrawEllipse(cRect(1,1,radius,radius), theme.Color(clrBackground), -2);
-
- pixmap->DrawEllipse(cRect(width-radius - 2,2,radius,radius), theme.Color(clrBorder), -1);
- pixmap->DrawEllipse(cRect(width-radius - 1,1,radius,radius), theme.Color(clrBackground), -1);
-
- if( height > 2*radius) {
- pixmap->DrawEllipse(cRect(2,height-radius - 2,radius,radius), theme.Color(clrBorder), -3);
- pixmap->DrawEllipse(cRect(1,height-radius - 1,radius,radius), theme.Color(clrBackground), -3);
-
- pixmap->DrawEllipse(cRect(width-radius - 2,height-radius - 2,radius,radius), theme.Color(clrBorder), -4);
- pixmap->DrawEllipse(cRect(width-radius - 1,height-radius - 1,radius,radius), theme.Color(clrBackground), -4);
- }
+ pixmap->DrawEllipse(cRect(2,2,radius,radius), theme.Color(clrBorder), -2);
+ pixmap->DrawEllipse(cRect(1,1,radius,radius), theme.Color(clrBackground), -2);
+
+ pixmap->DrawEllipse(cRect(width-radius - 2,2,radius,radius), theme.Color(clrBorder), -1);
+ pixmap->DrawEllipse(cRect(width-radius - 1,1,radius,radius), theme.Color(clrBackground), -1);
+
+ if( height > 2*radius) {
+ pixmap->DrawEllipse(cRect(2,height-radius - 2,radius,radius), theme.Color(clrBorder), -3);
+ pixmap->DrawEllipse(cRect(1,height-radius - 1,radius,radius), theme.Color(clrBackground), -3);
+
+ pixmap->DrawEllipse(cRect(width-radius - 2,height-radius - 2,radius,radius), theme.Color(clrBorder), -4);
+ pixmap->DrawEllipse(cRect(width-radius - 1,height-radius - 1,radius,radius), theme.Color(clrBackground), -4);
+ }
}
void cStyledPixmap::drawVerticalLine(int x, int yStart, int yStop, tColor col) {
- for (int y = yStart; y <= yStop; y++) {
- pixmap->DrawPixel(cPoint(x,y), col);
- }
+ for (int y = yStart; y <= yStop; y++) {
+ pixmap->DrawPixel(cPoint(x,y), col);
+ }
}
void cStyledPixmap::drawHorizontalLine(int y, int xStart, int xStop, tColor col) {
- for (int x = xStart; x <= xStop; x++) {
- pixmap->DrawPixel(cPoint(x,y), col);
- }
+ for (int x = xStart; x <= xStop; x++) {
+ pixmap->DrawPixel(cPoint(x,y), col);
+ }
}
void cStyledPixmap::DrawText(const cPoint &Point, const char *s, tColor ColorFg, tColor ColorBg, const cFont *Font) {
- pixmap->DrawText(Point, s, ColorFg, ColorBg, Font);
+ pixmap->DrawText(Point, s, ColorFg, ColorBg, Font);
}
void cStyledPixmap::DrawImage(const cPoint &Point, const cImage &Image) {
- pixmap->DrawImage(Point, Image);
+ pixmap->DrawImage(Point, Image);
}
void cStyledPixmap::DrawRectangle(const cRect &Rect, tColor Color) {
- pixmap->DrawRectangle(Rect,Color);
+ pixmap->DrawRectangle(Rect,Color);
}