summaryrefslogtreecommitdiff
path: root/helpers.c
diff options
context:
space:
mode:
Diffstat (limited to 'helpers.c')
-rw-r--r--helpers.c35
1 files changed, 15 insertions, 20 deletions
diff --git a/helpers.c b/helpers.c
index 97b2364..23076c8 100644
--- a/helpers.c
+++ b/helpers.c
@@ -1,19 +1,21 @@
#include <string>
#include <sstream>
#include <vector>
+#include "helpers.h"
+#include <vdr/skins.h>
-static cOsd *CreateOsd(int Left, int Top, int Width, int Height) {
+cOsd *CreateOsd(int Left, int Top, int Width, int Height) {
cOsd *osd = cOsdProvider::NewOsd(Left, Top);
if (osd) {
tArea Area = { 0, 0, Width, Height, 32 };
- if (osd->SetAreas(&Area, 1) == oeOk) {
+ if (osd->SetAreas(&Area, 1) == oeOk) {
return osd;
}
}
return NULL;
}
-static void DrawBlendedBackground(cPixmap *pixmap, int xStart, int width, tColor color, tColor colorBlending, bool fromTop) {
+void DrawBlendedBackground(cPixmap *pixmap, int xStart, int width, tColor color, tColor colorBlending, bool fromTop) {
int height = pixmap->ViewPort().Height();
int numSteps = 16;
int alphaStep = 0x0F;
@@ -34,12 +36,12 @@ static void DrawBlendedBackground(cPixmap *pixmap, int xStart, int width, tColor
clr = AlphaBlend(color, colorBlending, alpha);
pixmap->DrawRectangle(cRect(xStart,i,width,1), clr);
alpha += alphaStep;
- if (i == end)
+ if (i == end)
cont = false;
}
}
-static void DrawRoundedCorners(cPixmap *p, int radius, int x, int y, int width, int height) {
+void DrawRoundedCorners(cPixmap *p, int radius, int x, int y, int width, int height) {
if (radius > 2) {
p->DrawEllipse(cRect(x, y, radius, radius), clrTransparent, -2);
p->DrawEllipse(cRect(x + width - radius, y , radius, radius), clrTransparent, -1);
@@ -48,7 +50,7 @@ static void DrawRoundedCorners(cPixmap *p, int radius, int x, int y, int width,
}
}
-static void DrawRoundedCornersWithBorder(cPixmap *p, tColor borderColor, int radius, int width, int height) {
+void DrawRoundedCornersWithBorder(cPixmap *p, tColor borderColor, int radius, int width, int height) {
if (radius < 3)
return;
p->DrawEllipse(cRect(0,0,radius,radius), borderColor, -2);
@@ -56,21 +58,21 @@ static void DrawRoundedCornersWithBorder(cPixmap *p, tColor borderColor, int rad
p->DrawEllipse(cRect(width-radius,0,radius,radius), borderColor, -1);
p->DrawEllipse(cRect(width-radius+1,-1,radius,radius), clrTransparent, -1);
-
+
p->DrawEllipse(cRect(0,height-radius,radius,radius), borderColor, -3);
p->DrawEllipse(cRect(-1,height-radius+1,radius,radius), clrTransparent, -3);
-
+
p->DrawEllipse(cRect(width-radius,height-radius,radius,radius), borderColor, -4);
p->DrawEllipse(cRect(width-radius+1,height-radius+1,radius,radius), clrTransparent, -4);
}
-static cSize ScaleToFit(int widthMax, int heightMax, int widthOriginal, int heightOriginal) {
+cSize ScaleToFit(int widthMax, int heightMax, int widthOriginal, int heightOriginal) {
int width = 1;
int height = 1;
if ((widthMax == 0)||(heightMax==0)||(widthOriginal==0)||(heightOriginal==0))
return cSize(width, height);
-
+
if ((widthOriginal <= widthMax) && (heightOriginal <= heightMax)) {
width = widthOriginal;
height = heightOriginal;
@@ -91,7 +93,7 @@ static cSize ScaleToFit(int widthMax, int heightMax, int widthOriginal, int heig
return cSize(width, height);
}
-static int Minimum(int a, int b, int c, int d, int e, int f) {
+int Minimum(int a, int b, int c, int d, int e, int f) {
int min = a;
if (b < min) min = b;
if (c < min) min = c;
@@ -101,7 +103,7 @@ static int Minimum(int a, int b, int c, int d, int e, int f) {
return min;
}
-static std::string CutText(std::string text, int width, const cFont *font) {
+std::string CutText(std::string text, int width, const cFont *font) {
if (width <= font->Size())
return text.c_str();
cTextWrapper twText;
@@ -136,13 +138,6 @@ std::string StrToLowerCase(std::string str) {
return lowerCase;
}
-class splitstring : public std::string {
- std::vector<std::string> flds;
-public:
- splitstring(const char *s) : std::string(s) { };
- std::vector<std::string>& split(char delim, int rep=0);
-};
-
// split: receives a char delimiter; returns a vector of strings
// By default ignores repeated delimiters, unless argument rep == 1.
std::vector<std::string>& splitstring::split(char delim, int rep) {
@@ -165,4 +160,4 @@ std::vector<std::string>& splitstring::split(char delim, int rep) {
if (!buf.empty())
flds.push_back(buf);
return flds;
-} \ No newline at end of file
+}