summaryrefslogtreecommitdiff
path: root/interface.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2002-05-18 14:03:22 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2002-05-18 14:03:22 +0200
commitbdccbbe93e9729944787d3158bee7a755d3bf286 (patch)
tree17073d49ff0d2d94672c7301a7771f0b2724e42e /interface.c
parent3e5b31af5e88bc4e43971a70b5add6f67cebb701 (diff)
downloadvdr-bdccbbe93e9729944787d3158bee7a755d3bf286.tar.gz
vdr-bdccbbe93e9729944787d3158bee7a755d3bf286.tar.bz2
Completely moved OSD handling out of the cDvbApi class, into the new cOsd
Diffstat (limited to 'interface.c')
-rw-r--r--interface.c31
1 files changed, 16 insertions, 15 deletions
diff --git a/interface.c b/interface.c
index 0731f0d4..3bd48434 100644
--- a/interface.c
+++ b/interface.c
@@ -4,13 +4,14 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: interface.c 1.48 2002/05/13 16:30:22 kls Exp $
+ * $Id: interface.c 1.49 2002/05/18 13:08:20 kls Exp $
*/
#include "interface.h"
#include <ctype.h>
#include <unistd.h>
#include "i18n.h"
+#include "osd.h"
cInterface *Interface = NULL;
@@ -50,7 +51,7 @@ void cInterface::Open(int NumCols, int NumLines)
NumCols = Setup.OSDwidth;
if (NumLines == 0)
NumLines = Setup.OSDheight;
- cDvbApi::PrimaryDvbApi->Open(width = NumCols, height = NumLines);
+ cOsd::Open(width = NumCols, height = NumLines);
}
}
@@ -59,7 +60,7 @@ void cInterface::Close(void)
if (open == 1)
Clear();
if (!--open) {
- cDvbApi::PrimaryDvbApi->Close();
+ cOsd::Close();
width = height = 0;
}
}
@@ -125,31 +126,31 @@ eKeys cInterface::Wait(int Seconds, bool KeepChar)
void cInterface::Clear(void)
{
if (open)
- cDvbApi::PrimaryDvbApi->Clear();
+ cOsd::Clear();
}
void cInterface::ClearEol(int x, int y, eDvbColor Color)
{
if (open)
- cDvbApi::PrimaryDvbApi->ClrEol(x, y, Color);
+ cOsd::ClrEol(x, y, Color);
}
void cInterface::Fill(int x, int y, int w, int h, eDvbColor Color)
{
if (open)
- cDvbApi::PrimaryDvbApi->Fill(x, y, w, h, Color);
+ cOsd::Fill(x, y, w, h, Color);
}
void cInterface::SetBitmap(int x, int y, const cBitmap &Bitmap)
{
if (open)
- cDvbApi::PrimaryDvbApi->SetBitmap(x, y, Bitmap);
+ cOsd::SetBitmap(x, y, Bitmap);
}
void cInterface::Flush(void)
{
if (open)
- cDvbApi::PrimaryDvbApi->Flush();
+ cOsd::Flush();
}
void cInterface::SetCols(int *c)
@@ -163,7 +164,7 @@ void cInterface::SetCols(int *c)
eDvbFont cInterface::SetFont(eDvbFont Font)
{
- return cDvbApi::PrimaryDvbApi->SetFont(Font);
+ return cOsd::SetFont(Font);
}
char *cInterface::WrapText(const char *Text, int Width, int *Height)
@@ -183,7 +184,7 @@ char *cInterface::WrapText(const char *Text, int Width, int *Height)
char *Delim = NULL;
int w = 0;
- Width *= cDvbApi::PrimaryDvbApi->CellWidth();
+ Width *= cOsd::CellWidth();
while (*t && t[strlen(t) - 1] == '\n')
t[strlen(t) - 1] = 0; // skips trailing newlines
@@ -198,7 +199,7 @@ char *cInterface::WrapText(const char *Text, int Width, int *Height)
}
else if (isspace(*p))
Blank = p;
- int cw = cDvbApi::PrimaryDvbApi->Width(*p);
+ int cw = cOsd::Width(*p);
if (w + cw > Width) {
if (Blank) {
*Blank = '\n';
@@ -237,7 +238,7 @@ char *cInterface::WrapText(const char *Text, int Width, int *Height)
void cInterface::Write(int x, int y, const char *s, eDvbColor FgColor, eDvbColor BgColor)
{
if (open)
- cDvbApi::PrimaryDvbApi->Text(x, y, s, FgColor, BgColor);
+ cOsd::Text(x, y, s, FgColor, BgColor);
}
void cInterface::WriteText(int x, int y, const char *s, eDvbColor FgColor, eDvbColor BgColor)
@@ -278,7 +279,7 @@ void cInterface::Title(const char *s)
strn0cpy(buffer, s, n + 1);
Write(1, 0, buffer, clrBlack, clrCyan);
t++;
- Write(-(cDvbApi::PrimaryDvbApi->WidthInCells(t) + 1), 0, t, clrBlack, clrCyan);
+ Write(-(cOsd::WidthInCells(t) + 1), 0, t, clrBlack, clrCyan);
}
else {
int x = (Width() - strlen(s)) / 2;
@@ -337,12 +338,12 @@ void cInterface::HelpButton(int Index, const char *Text, eDvbColor FgColor, eDvb
{
if (open) {
const int w = Width() / 4;
- cDvbApi::PrimaryDvbApi->Fill(Index * w, -1, w, 1, Text ? BgColor : clrBackground);
+ cOsd::Fill(Index * w, -1, w, 1, Text ? BgColor : clrBackground);
if (Text) {
int l = (w - int(strlen(Text))) / 2;
if (l < 0)
l = 0;
- cDvbApi::PrimaryDvbApi->Text(Index * w + l, -1, Text, FgColor, BgColor);
+ cOsd::Text(Index * w + l, -1, Text, FgColor, BgColor);
}
}
}