11 #include <vdr/plugin.h>
12 #include <vdr/skins.h>
13 #include <vdr/videodir.h>
23 virtual int Width(uint c)
const {
return 1; }
25 virtual int Height(
void)
const {
return 1; }
34 #define clrBackground COLOR_BLACK
35 #define clrTransparent clrBackground
36 #define clrBlack clrBackground
37 #define clrRed COLOR_RED
38 #define clrGreen COLOR_GREEN
39 #define clrYellow COLOR_YELLOW
40 #define clrBlue COLOR_BLUE
41 #define clrMagenta COLOR_MAGENTA
42 #define clrCyan COLOR_CYAN
43 #define clrWhite COLOR_WHITE
69 virtual void SaveRegion(
int x1,
int y1,
int x2,
int y2);
73 virtual void Flush(
void);
83 leaveok(stdscr,
true);
101 int color = (colorBg << 16) | colorFg | 0x80000000;
105 init_pair(i + 1, colorFg, colorBg);
107 wattrset(
window, COLOR_PAIR(i + 1));
111 wattrset(
window, COLOR_PAIR(i + 1));
123 savedRegion = newwin(y2 - y1 + 1, x2 - x1 + 1, y1, x1);
138 int w = Font->
Width(s);
140 if (Width || Height) {
141 int cw = Width ? Width : w;
142 int ch = Height ? Height : h;
145 if ((Alignment &
taLeft) != 0)
147 else if ((Alignment &
taRight) != 0) {
153 x += (Width - w) / 2;
157 if ((Alignment &
taTop) != 0)
159 else if ((Alignment &
taBottom) != 0) {
165 y += (Height - h) / 2;
177 for (
int y = y1; y <= y2; y++) {
179 whline(
window,
' ', x2 - x1 + 1);
202 virtual void Flush(
void);
207 int Lines = WithInfo ? 5 : 1;
229 for (
int i = 0; i < 2; i++) {
230 const cEvent *e = !i ? Present : Following;
269 void DrawScrollbar(
int Total,
int Offset,
int Shown,
int Top,
int Height,
bool CanScrollUp,
bool CanScrollDown);
274 virtual void Scroll(
bool Up,
bool Page);
276 virtual void Clear(
void);
277 virtual void SetTitle(
const char *Title);
278 virtual void SetButtons(
const char *Red,
const char *Green = NULL,
const char *Yellow = NULL,
const char *Blue = NULL);
280 virtual void SetItem(
const char *Text,
int Index,
bool Current,
bool Selectable);
284 virtual void SetText(
const char *Text,
bool FixedFont);
286 virtual void Flush(
void);
303 if (Total > 0 && Total > Shown) {
305 int yb = yt + Height;
308 int th =
max(
int((sb - st) *
double(Shown) / Total + 0.5), 1);
309 int tt =
min(
int(st + (sb - st) *
double(Offset) / Total + 0.5), sb - th);
310 int tb =
min(tt + th, sb);
378 int ColorFg, ColorBg;
387 for (
int i = 0; i <
MaxTabs; i++) {
429 for (
int i = 0; Event->
Contents(i); i++) {
458 const char *Title = Info->
Title();
460 Title = Recording->
Name();
505 virtual void SetTitle(
const char *Title);
506 virtual void SetMode(
bool Play,
bool Forward,
int Speed);
509 virtual void SetTotal(
const char *Total);
510 virtual void SetJump(
const char *Jump);
512 virtual void Flush(
void);
536 if (Speed == -1) Mode = Play ?
" > " :
" || ";
537 else if (Play) Mode = Forward ?
" X>> " :
" <<X ";
538 else Mode = Forward ?
" X|> " :
" <|X ";
541 char *p = strchr(buf,
'X');
543 *p = Speed > 0 ?
'1' + Speed - 1 :
' ';
550 int p = Total > 0 ?
ScOsdWidth * Current / Total : 0;
597 virtual void Flush(
void);
617 const char *Prompt =
tr(
"Volume ");
642 virtual void SetTrack(
int Index,
const char *
const *Tracks);
644 virtual void Flush(
void);
651 for (
int i = 0; i < NumTracks; i++)
657 for (
int i = 0; i < NumTracks; i++)
669 int ColorFg, ColorBg;
686 SetItem(Tracks[Index], Index,
true);
703 virtual void Flush(
void);
747 return tr(
"Text mode");
793 virtual bool Start(
void);
829 WINDOW *w = initscr();