summaryrefslogtreecommitdiff
path: root/views
diff options
context:
space:
mode:
authorlouis <louis.braun@gmx.de>2014-10-25 16:58:05 +0200
committerlouis <louis.braun@gmx.de>2014-10-25 16:58:05 +0200
commit0b9e3787a2a920e010ab53330262fe8644e4b0d0 (patch)
tree77e7739b11a1c5dba0d96f9eb688f3d37e0af7fb /views
parentee39eb8066f977d2adb3be71b6c34a7d6af4a22c (diff)
downloadvdr-plugin-skindesigner-0b9e3787a2a920e010ab53330262fe8644e4b0d0.tar.gz
vdr-plugin-skindesigner-0b9e3787a2a920e010ab53330262fe8644e4b0d0.tar.bz2
implemented function drawslope
Diffstat (limited to 'views')
-rw-r--r--views/view.c29
-rw-r--r--views/view.h1
2 files changed, 30 insertions, 0 deletions
diff --git a/views/view.c b/views/view.c
index 3b72253..75a24e0 100644
--- a/views/view.c
+++ b/views/view.c
@@ -251,6 +251,9 @@ void cView::DrawPixmap(int num, cTemplatePixmap *pix, map < string, vector< map<
case ftDrawEllipse:
DoDrawEllipse(num, func);
break;
+ case ftDrawSlope:
+ DoDrawSlope(num, func);
+ break;
case ftDrawImage:
DoDrawImage(num, func);
break;
@@ -348,6 +351,9 @@ void cView::DrawLoop(int numPixmap, cTemplateFunction *func, map < string, vecto
case ftDrawEllipse:
DoDrawEllipse(numPixmap, func, x0, y0);
break;
+ case ftDrawSlope:
+ DoDrawSlope(numPixmap, func, x0, y0);
+ break;
case ftDrawImage:
DoDrawImage(numPixmap, func, x0, y0);
break;
@@ -634,9 +640,32 @@ void cView::DoDrawEllipse(int num, cTemplateFunction *func, int x0, int y0) {
cRect size(x, y, w, h);
tColor clr = func->GetColorParameter(ptColor);
int quadrant = func->GetNumericParameter(ptQuadrant);
+ if (quadrant < -4 || quadrant > 8) {
+ esyslog("skindesigner: wrong quadrant %d for drawellipse, allowed values are from -4 to 8", quadrant);
+ quadrant = 0;
+ }
DrawEllipse(num, size, clr, quadrant);
}
+void cView::DoDrawSlope(int num, cTemplateFunction *func, int x0, int y0) {
+ int x = func->GetNumericParameter(ptX);
+ int y = func->GetNumericParameter(ptY);
+ if (x < 0) x = 0;
+ x += x0;
+ if (y < 0) y = 0;
+ y += y0;
+ int w = func->GetNumericParameter(ptWidth);
+ int h = func->GetNumericParameter(ptHeight);
+ cRect size(x, y, w, h);
+ tColor clr = func->GetColorParameter(ptColor);
+ int type = func->GetNumericParameter(ptType);
+ if (type < 0 || type > 7) {
+ esyslog("skindesigner: wrong type %d for drawslope, allowed values are from 0 to 7", type);
+ type = 0;
+ }
+ DrawSlope(num, size, clr, type);
+}
+
void cView::DoDrawImage(int num, cTemplateFunction *func, int x0, int y0) {
int x = func->GetNumericParameter(ptX);
int y = func->GetNumericParameter(ptY);
diff --git a/views/view.h b/views/view.h
index 4609935..a793c31 100644
--- a/views/view.h
+++ b/views/view.h
@@ -17,6 +17,7 @@ private:
void DoDrawFloatingTextBox(int num, cTemplateFunction *func);
void DoDrawRectangle(int num, cTemplateFunction *func, int x0 = 0, int y0 = 0);
void DoDrawEllipse(int num, cTemplateFunction *func, int x0 = 0, int y0 = 0);
+ void DoDrawSlope(int num, cTemplateFunction *func, int x0 = 0, int y0 = 0);
void DoDrawImage(int num, cTemplateFunction *func, int x0 = 0, int y0 = 0);
void ActivateScrolling(void);
protected: