vdr  2.4.1
skincurses.c
Go to the documentation of this file.
1 /*
2  * skincurses.c: A plugin for the Video Disk Recorder
3  *
4  * See the README file for copyright information and how to reach the author.
5  *
6  * $Id: skincurses.c 4.3.1.1 2019/03/12 12:28:04 kls Exp $
7  */
8 
9 #include <ncurses.h>
10 #include <vdr/osd.h>
11 #include <vdr/plugin.h>
12 #include <vdr/skins.h>
13 #include <vdr/videodir.h>
14 #include <vdr/tools.h>
15 
16 static const char *VERSION = "2.4.1";
17 static const char *DESCRIPTION = trNOOP("A text only skin");
18 static const char *MAINMENUENTRY = NULL;
19 
20 // --- cCursesFont -----------------------------------------------------------
21 
22 class cCursesFont : public cFont {
23 public:
24  virtual int Width(void) const { return 1; }
25  virtual int Width(uint c) const { return 1; }
26  virtual int Width(const char *s) const { return s ? Utf8StrLen(s) : 0; }
27  virtual int Height(void) const { return 1; }
28  virtual void DrawText(cBitmap *Bitmap, int x, int y, const char *s, tColor ColorFg, tColor ColorBg, int Width) const {}
29  virtual void DrawText(cPixmap *Pixmap, int x, int y, const char *s, tColor ColorFg, tColor ColorBg, int Width) const {}
30  };
31 
32 static const cCursesFont Font = cCursesFont(); // w/o the '= cCursesFont()' gcc 4.6 complains - can anybody explain why this is necessary?
33 
34 // --- cCursesOsd ------------------------------------------------------------
35 
36 #define clrBackground COLOR_BLACK
37 #define clrTransparent clrBackground
38 #define clrBlack clrBackground
39 #define clrRed COLOR_RED
40 #define clrGreen COLOR_GREEN
41 #define clrYellow COLOR_YELLOW
42 #define clrBlue COLOR_BLUE
43 #define clrMagenta COLOR_MAGENTA
44 #define clrCyan COLOR_CYAN
45 #define clrWhite COLOR_WHITE
46 
47 static int clrMessage[] = {
48  clrBlack,
49  clrCyan,
50  clrBlack,
51  clrGreen,
52  clrBlack,
53  clrYellow,
54  clrWhite,
55  clrRed
56  };
57 
58 static int ScOsdWidth = 50;
59 static int ScOsdHeight = 20;
60 
61 class cCursesOsd : public cOsd {
62 private:
63  WINDOW *savedRegion;
64  WINDOW *window;
65  enum { MaxColorPairs = 16 };
67  void SetColor(int colorFg, int colorBg = clrBackground);
68 public:
69  cCursesOsd(int Left, int Top);
70  virtual ~cCursesOsd();
71  virtual void SaveRegion(int x1, int y1, int x2, int y2);
72  virtual void RestoreRegion(void);
73  virtual void DrawText(int x, int y, const char *s, tColor ColorFg, tColor ColorBg, const cFont *Font, int Width = 0, int Height = 0, int Alignment = taDefault);
74  virtual void DrawRectangle(int x1, int y1, int x2, int y2, tColor Color);
75  virtual void Flush(void);
76  };
77 
78 cCursesOsd::cCursesOsd(int Left, int Top)
79 :cOsd(Left, Top, 0)
80 {
81  savedRegion = NULL;
82 
83  memset(colorPairs, 0x00, sizeof(colorPairs));
84  start_color();
85  leaveok(stdscr, true);
86 
87  window = subwin(stdscr, ScOsdHeight, ScOsdWidth, 0, 0);
88  syncok(window, true);
89 }
90 
92 {
93  if (window) {
94  werase(window);
95  Flush();
96  delwin(window);
97  window = NULL;
98  }
99 }
100 
101 void cCursesOsd::SetColor(int colorFg, int colorBg)
102 {
103  int color = (colorBg << 16) | colorFg | 0x80000000;
104  for (int i = 0; i < MaxColorPairs; i++) {
105  if (!colorPairs[i]) {
106  colorPairs[i] = color;
107  init_pair(i + 1, colorFg, colorBg);
108  //XXX??? attron(COLOR_PAIR(WHITE_ON_BLUE));
109  wattrset(window, COLOR_PAIR(i + 1));
110  break;
111  }
112  else if (color == colorPairs[i]) {
113  wattrset(window, COLOR_PAIR(i + 1));
114  break;
115  }
116  }
117 }
118 
119 void cCursesOsd::SaveRegion(int x1, int y1, int x2, int y2)
120 {
121  if (savedRegion) {
122  delwin(savedRegion);
123  savedRegion = NULL;
124  }
125  savedRegion = newwin(y2 - y1 + 1, x2 - x1 + 1, y1, x1);
126  copywin(window, savedRegion, y1, x1, 0, 0, y2 - y1, x2 - x1, false);
127 }
128 
130 {
131  int begy, begx;
132  int maxy, maxx;
133  getmaxyx(savedRegion, maxy,maxx);
134  getbegyx(savedRegion, begy,begx);
135  if (savedRegion) {
136  copywin(savedRegion, window, 0, 0, begy, begx, maxy - begy, maxx - begx, false);
137  delwin(savedRegion);
138  savedRegion = NULL;
139  }
140 }
141 
142 void cCursesOsd::DrawText(int x, int y, const char *s, tColor ColorFg, tColor ColorBg, const cFont *Font, int Width, int Height, int Alignment)
143 {
144  int w = Font->Width(s);
145  int h = Font->Height();
146  if (Width || Height) {
147  int cw = Width ? Width : w;
148  int ch = Height ? Height : h;
149  DrawRectangle(x, y, x + cw - 1, y + ch - 1, ColorBg);
150  if (Width) {
151  if ((Alignment & taLeft) != 0)
152  ;
153  else if ((Alignment & taRight) != 0) {
154  if (w < Width)
155  x += Width - w;
156  }
157  else { // taCentered
158  if (w < Width)
159  x += (Width - w) / 2;
160  }
161  }
162  if (Height) {
163  if ((Alignment & taTop) != 0)
164  ;
165  else if ((Alignment & taBottom) != 0) {
166  if (h < Height)
167  y += Height - h;
168  }
169  else { // taCentered
170  if (h < Height)
171  y += (Height - h) / 2;
172  }
173  }
174  }
175  SetColor(ColorFg, ColorBg);
176  wmove(window, y, x); // ncurses wants 'y' before 'x'!
177  waddnstr(window, s, Width ? Width : ScOsdWidth - x);
178 }
179 
180 void cCursesOsd::DrawRectangle(int x1, int y1, int x2, int y2, tColor Color)
181 {
182  SetColor(Color, Color);
183  for (int y = y1; y <= y2; y++) {
184  wmove(window, y, x1); // ncurses wants 'y' before 'x'!
185  whline(window, ' ', x2 - x1 + 1);
186  }
187  wsyncup(window); // shouldn't be necessary because of 'syncok()', but w/o it doesn't work
188 }
189 
191 {
192  refresh();
193 }
194 
195 // --- cSkinCursesDisplayChannel ---------------------------------------------
196 
198 private:
201  bool message;
202 public:
203  cSkinCursesDisplayChannel(bool WithInfo);
204  virtual ~cSkinCursesDisplayChannel();
205  virtual void SetChannel(const cChannel *Channel, int Number);
206  virtual void SetEvents(const cEvent *Present, const cEvent *Following);
207  virtual void SetMessage(eMessageType Type, const char *Text);
208  virtual void Flush(void);
209  };
210 
212 {
213  int Lines = WithInfo ? 5 : 1;
214  message = false;
215  osd = new cCursesOsd(0, Setup.ChannelInfoPos ? 0 : ScOsdHeight - Lines);
216  timeWidth = strlen("00:00");
217  osd->DrawRectangle(0, 0, ScOsdWidth - 1, Lines - 1, clrBackground);
218 }
219 
221 {
222  delete osd;
223 }
224 
225 void cSkinCursesDisplayChannel::SetChannel(const cChannel *Channel, int Number)
226 {
227  osd->DrawRectangle(0, 0, ScOsdWidth - 1, 0, clrBackground);
228  osd->DrawText(0, 0, ChannelString(Channel, Number), clrWhite, clrBackground, &Font);
229 }
230 
231 void cSkinCursesDisplayChannel::SetEvents(const cEvent *Present, const cEvent *Following)
232 {
233  osd->DrawRectangle(0, 1, timeWidth - 1, 4, clrRed);
235  for (int i = 0; i < 2; i++) {
236  const cEvent *e = !i ? Present : Following;
237  if (e) {
238  osd->DrawText( 0, 2 * i + 1, e->GetTimeString(), clrWhite, clrRed, &Font);
239  osd->DrawText(timeWidth + 1, 2 * i + 1, e->Title(), clrCyan, clrBackground, &Font);
240  osd->DrawText(timeWidth + 1, 2 * i + 2, e->ShortText(), clrYellow, clrBackground, &Font);
241  }
242  }
243 }
244 
246 {
247  if (Text) {
248  osd->SaveRegion(0, 0, ScOsdWidth - 1, 0);
249  osd->DrawText(0, 0, Text, clrMessage[2 * Type], clrMessage[2 * Type + 1], &Font, ScOsdWidth, 0, taCenter);
250  message = true;
251  }
252  else {
253  osd->RestoreRegion();
254  message = false;
255  }
256 }
257 
259 {
260  if (!message) {
261  cString date = DayDateTime();
263  }
264  osd->Flush();
265 }
266 
267 // --- cSkinCursesDisplayMenu ------------------------------------------------
268 
270 private:
274  void DrawTitle(void);
275  void DrawScrollbar(int Total, int Offset, int Shown, int Top, int Height, bool CanScrollUp, bool CanScrollDown);
276  void SetTextScrollbar(void);
277 public:
279  virtual ~cSkinCursesDisplayMenu();
280  virtual void Scroll(bool Up, bool Page);
281  virtual int MaxItems(void);
282  virtual void Clear(void);
283  virtual void SetTitle(const char *Title);
284  virtual void SetButtons(const char *Red, const char *Green = NULL, const char *Yellow = NULL, const char *Blue = NULL);
285  virtual void SetMessage(eMessageType Type, const char *Text);
286  virtual void SetItem(const char *Text, int Index, bool Current, bool Selectable);
287  virtual void SetScrollbar(int Total, int Offset);
288  virtual void SetEvent(const cEvent *Event);
289  virtual void SetRecording(const cRecording *Recording);
290  virtual void SetText(const char *Text, bool FixedFont);
291  virtual const cFont *GetTextAreaFont(bool FixedFont) const { return &Font; }
292  virtual void Flush(void);
293  };
294 
296 {
297  osd = new cCursesOsd(0, 0);
298  lastDiskUsageState = -1;
300 }
301 
303 {
304  delete osd;
305 }
306 
307 void cSkinCursesDisplayMenu::DrawScrollbar(int Total, int Offset, int Shown, int Top, int Height, bool CanScrollUp, bool CanScrollDown)
308 {
309  if (Total > 0 && Total > Shown) {
310  int yt = Top;
311  int yb = yt + Height;
312  int st = yt;
313  int sb = yb;
314  int th = max(int((sb - st) * double(Shown) / Total + 0.5), 1);
315  int tt = min(int(st + (sb - st) * double(Offset) / Total + 0.5), sb - th);
316  int tb = min(tt + th, sb);
317  int xl = ScOsdWidth - 1;
318  osd->DrawRectangle(xl, st, xl, sb - 1, clrWhite);
319  osd->DrawRectangle(xl, tt, xl, tb - 1, clrCyan);
320  }
321 }
322 
324 {
325  if (textScroller.CanScroll())
327 }
328 
329 void cSkinCursesDisplayMenu::Scroll(bool Up, bool Page)
330 {
331  cSkinDisplayMenu::Scroll(Up, Page);
333 }
334 
336 {
337  return ScOsdHeight - 4;
338 }
339 
341 {
344 }
345 
347 {
348  bool WithDisk = MenuCategory() == mcMain || MenuCategory() == mcRecording;
349  osd->DrawText(0, 0, WithDisk ? cString::sprintf("%s - %s", *title, *cVideoDiskUsage::String()) : title, clrBlack, clrCyan, &Font, ScOsdWidth);
350 }
351 
352 void cSkinCursesDisplayMenu::SetTitle(const char *Title)
353 {
354  title = Title;
355  DrawTitle();
356 }
357 
358 void cSkinCursesDisplayMenu::SetButtons(const char *Red, const char *Green, const char *Yellow, const char *Blue)
359 {
360  int w = ScOsdWidth;
361  int t0 = 0;
362  int t1 = 0 + w / 4;
363  int t2 = 0 + w / 2;
364  int t3 = w - w / 4;
365  int t4 = w;
366  int y = ScOsdHeight - 1;
367  osd->DrawText(t0, y, Red, clrWhite, Red ? clrRed : clrBackground, &Font, t1 - t0, 0, taCenter);
368  osd->DrawText(t1, y, Green, clrBlack, Green ? clrGreen : clrBackground, &Font, t2 - t1, 0, taCenter);
369  osd->DrawText(t2, y, Yellow, clrBlack, Yellow ? clrYellow : clrBackground, &Font, t3 - t2, 0, taCenter);
370  osd->DrawText(t3, y, Blue, clrWhite, Blue ? clrBlue : clrBackground, &Font, t4 - t3, 0, taCenter);
371 }
372 
374 {
375  if (Text)
376  osd->DrawText(0, ScOsdHeight - 2, Text, clrMessage[2 * Type], clrMessage[2 * Type + 1], &Font, ScOsdWidth, 0, taCenter);
377  else
379 }
380 
381 void cSkinCursesDisplayMenu::SetItem(const char *Text, int Index, bool Current, bool Selectable)
382 {
383  int y = 2 + Index;
384  int ColorFg, ColorBg;
385  if (Current) {
386  ColorFg = clrBlack;
387  ColorBg = clrCyan;
388  }
389  else {
390  ColorFg = Selectable ? clrWhite : clrCyan;
391  ColorBg = clrBackground;
392  }
393  for (int i = 0; i < MaxTabs; i++) {
394  const char *s = GetTabbedText(Text, i);
395  if (s) {
396  int xt = Tab(i) / AvgCharWidth();// Tab() is in "pixel" - see also skins.c!!!
397  osd->DrawText(xt, y, s, ColorFg, ColorBg, &Font, ScOsdWidth - 2 - xt);
398  }
399  if (!Tab(i + 1))
400  break;
401  }
402  SetEditableWidth(ScOsdWidth - 2 - Tab(1) / AvgCharWidth()); // Tab() is in "pixel" - see also skins.c!!!
403 }
404 
405 void cSkinCursesDisplayMenu::SetScrollbar(int Total, int Offset)
406 {
407  DrawScrollbar(Total, Offset, MaxItems(), 2, MaxItems(), Offset > 0, Offset + MaxItems() < Total);
408 }
409 
411 {
412  if (!Event)
413  return;
414  int y = 2;
415  cTextScroller ts;
416  cString t = cString::sprintf("%s %s - %s", *Event->GetDateString(), *Event->GetTimeString(), *Event->GetEndTimeString());
417  ts.Set(osd, 0, y, ScOsdWidth, ScOsdHeight - y - 2, t, &Font, clrYellow, clrBackground);
418  if (Event->Vps() && Event->Vps() != Event->StartTime()) {
419  cString buffer = cString::sprintf(" VPS: %s", *Event->GetVpsString());
420  osd->DrawText(ScOsdWidth - Utf8StrLen(buffer), y, buffer, clrBlack, clrYellow, &Font);
421  }
422  y += ts.Height();
423  if (Event->ParentalRating()) {
424  cString buffer = cString::sprintf(" %s ", *Event->GetParentalRatingString());
425  osd->DrawText(ScOsdWidth - Utf8StrLen(buffer), y, buffer, clrBlack, clrYellow, &Font);
426  }
427  y += 1;
428  ts.Set(osd, 0, y, ScOsdWidth, ScOsdHeight - y - 2, Event->Title(), &Font, clrCyan, clrBackground);
429  y += ts.Height();
430  if (!isempty(Event->ShortText())) {
431  ts.Set(osd, 0, y, ScOsdWidth, ScOsdHeight - y - 2, Event->ShortText(), &Font, clrYellow, clrBackground);
432  y += ts.Height();
433  }
434  for (int i = 0; Event->Contents(i); i++) {
435  const char *s = Event->ContentToString(Event->Contents(i));
436  if (!isempty(s)) {
437  ts.Set(osd, 0, y, ScOsdWidth, ScOsdHeight - y - 2, s, &Font, clrYellow, clrBackground);
438  y += 1;
439  }
440  }
441  y += 1;
442  if (!isempty(Event->Description())) {
443  textScroller.Set(osd, 0, y, ScOsdWidth - 2, ScOsdHeight - y - 2, Event->Description(), &Font, clrCyan, clrBackground);
445  }
446 }
447 
449 {
450  if (!Recording)
451  return;
452  const cRecordingInfo *Info = Recording->Info();
453  int y = 2;
454  cTextScroller ts;
455  cString t = cString::sprintf("%s %s %s", *DateString(Recording->Start()), *TimeString(Recording->Start()), Info->ChannelName() ? Info->ChannelName() : "");
456  ts.Set(osd, 0, y, ScOsdWidth, ScOsdHeight - y - 2, t, &Font, clrYellow, clrBackground);
457  y += ts.Height();
458  if (Info->GetEvent()->ParentalRating()) {
459  cString buffer = cString::sprintf(" %s ", *Info->GetEvent()->GetParentalRatingString());
460  osd->DrawText(ScOsdWidth - Utf8StrLen(buffer), y, buffer, clrBlack, clrYellow, &Font);
461  }
462  y += 1;
463  const char *Title = Info->Title();
464  if (isempty(Title))
465  Title = Recording->Name();
466  ts.Set(osd, 0, y, ScOsdWidth, ScOsdHeight - y - 2, Title, &Font, clrCyan, clrBackground);
467  y += ts.Height();
468  if (!isempty(Info->ShortText())) {
469  ts.Set(osd, 0, y, ScOsdWidth, ScOsdHeight - y - 2, Info->ShortText(), &Font, clrYellow, clrBackground);
470  y += ts.Height();
471  }
472  for (int i = 0; Info->GetEvent()->Contents(i); i++) {
473  const char *s = Info->GetEvent()->ContentToString(Info->GetEvent()->Contents(i));
474  if (!isempty(s)) {
475  ts.Set(osd, 0, y, ScOsdWidth, ScOsdHeight - y - 2, s, &Font, clrYellow, clrBackground);
476  y += 1;
477  }
478  }
479  y += 1;
480  if (!isempty(Info->Description())) {
481  textScroller.Set(osd, 0, y, ScOsdWidth - 2, ScOsdHeight - y - 2, Info->Description(), &Font, clrCyan, clrBackground);
483  }
484 }
485 
486 void cSkinCursesDisplayMenu::SetText(const char *Text, bool FixedFont)
487 {
490 }
491 
493 {
495  DrawTitle();
496  cString date = DayDateTime();
497  osd->DrawText(ScOsdWidth - Utf8StrLen(date) - 2, 0, date, clrBlack, clrCyan, &Font);
498  osd->Flush();
499 }
500 
501 // --- cSkinCursesDisplayReplay ----------------------------------------------
502 
504 private:
506  bool message;
507 public:
508  cSkinCursesDisplayReplay(bool ModeOnly);
509  virtual ~cSkinCursesDisplayReplay();
510  virtual void SetTitle(const char *Title);
511  virtual void SetMode(bool Play, bool Forward, int Speed);
512  virtual void SetProgress(int Current, int Total);
513  virtual void SetCurrent(const char *Current);
514  virtual void SetTotal(const char *Total);
515  virtual void SetJump(const char *Jump);
516  virtual void SetMessage(eMessageType Type, const char *Text);
517  virtual void Flush(void);
518  };
519 
521 {
522  message = false;
523  osd = new cCursesOsd(0, ScOsdHeight - 3);
524  osd->DrawRectangle(0, 0, ScOsdWidth - 1, 2, ModeOnly ? clrTransparent : clrBackground);
525 }
526 
528 {
529  delete osd;
530 }
531 
532 void cSkinCursesDisplayReplay::SetTitle(const char *Title)
533 {
534  osd->DrawText(0, 0, Title, clrWhite, clrBackground, &Font, ScOsdWidth);
535 }
536 
537 void cSkinCursesDisplayReplay::SetMode(bool Play, bool Forward, int Speed)
538 {
539  if (Setup.ShowReplayMode) {
540  const char *Mode;
541  if (Speed == -1) Mode = Play ? " > " : " || ";
542  else if (Play) Mode = Forward ? " X>> " : " <<X ";
543  else Mode = Forward ? " X|> " : " <|X ";
544  char buf[16];
545  strn0cpy(buf, Mode, sizeof(buf));
546  char *p = strchr(buf, 'X');
547  if (p)
548  *p = Speed > 0 ? '1' + Speed - 1 : ' ';
549  SetJump(buf);
550  }
551 }
552 
553 void cSkinCursesDisplayReplay::SetProgress(int Current, int Total)
554 {
555  int p = Total > 0 ? ScOsdWidth * Current / Total : 0;
556  osd->DrawRectangle(0, 1, p, 1, clrGreen);
557  osd->DrawRectangle(p, 1, ScOsdWidth, 1, clrWhite);
558 }
559 
560 void cSkinCursesDisplayReplay::SetCurrent(const char *Current)
561 {
563 }
564 
565 void cSkinCursesDisplayReplay::SetTotal(const char *Total)
566 {
567  osd->DrawText(ScOsdWidth - Utf8StrLen(Total), 2, Total, clrWhite, clrBackground, &Font);
568 }
569 
570 void cSkinCursesDisplayReplay::SetJump(const char *Jump)
571 {
572  osd->DrawText(ScOsdWidth / 4, 2, Jump, clrWhite, clrBackground, &Font, ScOsdWidth / 2, 0, taCenter);
573 }
574 
576 {
577  if (Text) {
578  osd->SaveRegion(0, 2, ScOsdWidth - 1, 2);
579  osd->DrawText(0, 2, Text, clrMessage[2 * Type], clrMessage[2 * Type + 1], &Font, ScOsdWidth, 0, taCenter);
580  message = true;
581  }
582  else {
583  osd->RestoreRegion();
584  message = false;
585  }
586 }
587 
589 {
590  osd->Flush();
591 }
592 
593 // --- cSkinCursesDisplayVolume ----------------------------------------------
594 
596 private:
598 public:
600  virtual ~cSkinCursesDisplayVolume();
601  virtual void SetVolume(int Current, int Total, bool Mute);
602  virtual void Flush(void);
603  };
604 
606 {
607  osd = new cCursesOsd(0, ScOsdHeight - 1);
608 }
609 
611 {
612  delete osd;
613 }
614 
615 void cSkinCursesDisplayVolume::SetVolume(int Current, int Total, bool Mute)
616 {
617  if (Mute) {
618  osd->DrawRectangle(0, 0, ScOsdWidth - 1, 0, clrTransparent);
619  osd->DrawText(0, 0, tr("Key$Mute"), clrGreen, clrBackground, &Font);
620  }
621  else {
622  // TRANSLATORS: note the trailing blank!
623  const char *Prompt = tr("Volume ");
624  int l = Utf8StrLen(Prompt);
625  int p = (ScOsdWidth - l) * Current / Total;
626  osd->DrawText(0, 0, Prompt, clrGreen, clrBackground, &Font);
627  osd->DrawRectangle(l, 0, l + p - 1, 0, clrGreen);
628  osd->DrawRectangle(l + p, 0, ScOsdWidth - 1, 0, clrWhite);
629  }
630 }
631 
633 {
634  osd->Flush();
635 }
636 
637 // --- cSkinCursesDisplayTracks ----------------------------------------------
638 
640 private:
644  void SetItem(const char *Text, int Index, bool Current);
645 public:
646  cSkinCursesDisplayTracks(const char *Title, int NumTracks, const char * const *Tracks);
647  virtual ~cSkinCursesDisplayTracks();
648  virtual void SetTrack(int Index, const char * const *Tracks);
649  virtual void SetAudioChannel(int AudioChannel) {}
650  virtual void Flush(void);
651  };
652 
653 cSkinCursesDisplayTracks::cSkinCursesDisplayTracks(const char *Title, int NumTracks, const char * const *Tracks)
654 {
655  currentIndex = -1;
656  itemsWidth = Font.Width(Title);
657  for (int i = 0; i < NumTracks; i++)
658  itemsWidth = max(itemsWidth, Font.Width(Tracks[i]));
660  osd = new cCursesOsd(0, 0);
662  osd->DrawText(0, 0, Title, clrBlack, clrCyan, &Font, itemsWidth);
663  for (int i = 0; i < NumTracks; i++)
664  SetItem(Tracks[i], i, false);
665 }
666 
668 {
669  delete osd;
670 }
671 
672 void cSkinCursesDisplayTracks::SetItem(const char *Text, int Index, bool Current)
673 {
674  int y = 1 + Index;
675  int ColorFg, ColorBg;
676  if (Current) {
677  ColorFg = clrBlack;
678  ColorBg = clrCyan;
679  currentIndex = Index;
680  }
681  else {
682  ColorFg = clrWhite;
683  ColorBg = clrBackground;
684  }
685  osd->DrawText(0, y, Text, ColorFg, ColorBg, &Font, itemsWidth);
686 }
687 
688 void cSkinCursesDisplayTracks::SetTrack(int Index, const char * const *Tracks)
689 {
690  if (currentIndex >= 0)
691  SetItem(Tracks[currentIndex], currentIndex, false);
692  SetItem(Tracks[Index], Index, true);
693 }
694 
696 {
697  osd->Flush();
698 }
699 
700 // --- cSkinCursesDisplayMessage ---------------------------------------------
701 
703 private:
705 public:
707  virtual ~cSkinCursesDisplayMessage();
708  virtual void SetMessage(eMessageType Type, const char *Text);
709  virtual void Flush(void);
710  };
711 
713 {
714  osd = new cCursesOsd(0, ScOsdHeight - 1);
715 }
716 
718 {
719  delete osd;
720 }
721 
723 {
724  osd->DrawText(0, 0, Text, clrMessage[2 * Type], clrMessage[2 * Type + 1], &Font, ScOsdWidth, 0, taCenter);
725 }
726 
728 {
729  osd->Flush();
730 }
731 
732 // --- cSkinCurses -----------------------------------------------------------
733 
734 class cSkinCurses : public cSkin {
735 public:
736  cSkinCurses(void);
737  virtual const char *Description(void);
738  virtual cSkinDisplayChannel *DisplayChannel(bool WithInfo);
739  virtual cSkinDisplayMenu *DisplayMenu(void);
740  virtual cSkinDisplayReplay *DisplayReplay(bool ModeOnly);
741  virtual cSkinDisplayVolume *DisplayVolume(void);
742  virtual cSkinDisplayTracks *DisplayTracks(const char *Title, int NumTracks, const char * const *Tracks);
743  virtual cSkinDisplayMessage *DisplayMessage(void);
744  };
745 
747 :cSkin("curses")
748 {
749 }
750 
751 const char *cSkinCurses::Description(void)
752 {
753  return tr("Text mode");
754 }
755 
757 {
758  return new cSkinCursesDisplayChannel(WithInfo);
759 }
760 
762 {
763  return new cSkinCursesDisplayMenu;
764 }
765 
767 {
768  return new cSkinCursesDisplayReplay(ModeOnly);
769 }
770 
772 {
773  return new cSkinCursesDisplayVolume;
774 }
775 
776 cSkinDisplayTracks *cSkinCurses::DisplayTracks(const char *Title, int NumTracks, const char * const *Tracks)
777 {
778  return new cSkinCursesDisplayTracks(Title, NumTracks, Tracks);
779 }
780 
782 {
783  return new cSkinCursesDisplayMessage;
784 }
785 
786 // --- cPluginSkinCurses -----------------------------------------------------
787 
788 class cPluginSkinCurses : public cPlugin {
789 private:
790  // Add any member variables or functions you may need here.
791 public:
792  cPluginSkinCurses(void);
793  virtual ~cPluginSkinCurses();
794  virtual const char *Version(void) { return VERSION; }
795  virtual const char *Description(void) { return tr(DESCRIPTION); }
796  virtual const char *CommandLineHelp(void);
797  virtual bool ProcessArgs(int argc, char *argv[]);
798  virtual bool Initialize(void);
799  virtual bool Start(void);
800  virtual void Housekeeping(void);
801  virtual const char *MainMenuEntry(void) { return tr(MAINMENUENTRY); }
802  virtual cOsdObject *MainMenuAction(void);
803  virtual cMenuSetupPage *SetupMenu(void);
804  virtual bool SetupParse(const char *Name, const char *Value);
805  };
806 
808 {
809  // Initialize any member variables here.
810  // DON'T DO ANYTHING ELSE THAT MAY HAVE SIDE EFFECTS, REQUIRE GLOBAL
811  // VDR OBJECTS TO EXIST OR PRODUCE ANY OUTPUT!
812 }
813 
815 {
816  // Clean up after yourself!
817  endwin();
818 }
819 
821 {
822  // Return a string that describes all known command line options.
823  return NULL;
824 }
825 
826 bool cPluginSkinCurses::ProcessArgs(int argc, char *argv[])
827 {
828  // Implement command line argument processing here if applicable.
829  return true;
830 }
831 
833 {
834  // Initialize any background activities the plugin shall perform.
835  WINDOW *w = initscr();
836  int begy, begx;
837  int maxy, maxx;
838  getmaxyx(w, maxy,maxx);
839  getbegyx(w, begy,begx);
840  if (w) {
841  ScOsdWidth = maxx - begx + 1;
842  ScOsdHeight = maxy - begy + 1;
843  return true;
844  }
845  esyslog("skincurses: unable to initialize curses screen");
846  return false;
847 }
848 
850 {
851  // Start any background activities the plugin shall perform.
852  cSkin *Skin = new cSkinCurses;
853  // This skin is normally used for debugging, so let's make it the current one:
854  Skins.SetCurrent(Skin->Name());
855  return true;
856 }
857 
859 {
860  // Perform any cleanup or other regular tasks.
861 }
862 
864 {
865  // Perform the action when selected from the main VDR menu.
866  return NULL;
867 }
868 
870 {
871  // Return a setup menu in case the plugin supports one.
872  return NULL;
873 }
874 
875 bool cPluginSkinCurses::SetupParse(const char *Name, const char *Value)
876 {
877  // Parse your own setup parameters and store their values.
878  return false;
879 }
880 
881 VDRPLUGINCREATOR(cPluginSkinCurses); // Don't touch this!
cSkinCursesDisplayChannel::message
bool message
Definition: skincurses.c:201
cSkinCurses::DisplayTracks
virtual cSkinDisplayTracks * DisplayTracks(const char *Title, int NumTracks, const char *const *Tracks)
Creates and returns a new object for displaying the available tracks.
Definition: skincurses.c:776
cSkinCursesDisplayMenu::SetItem
virtual void SetItem(const char *Text, int Index, bool Current, bool Selectable)
Sets the item at the given Index to Text.
Definition: skincurses.c:381
cSkinCursesDisplayTracks::currentIndex
int currentIndex
Definition: skincurses.c:643
cCursesOsd::DrawText
virtual void DrawText(int x, int y, const char *s, tColor ColorFg, tColor ColorBg, const cFont *Font, int Width=0, int Height=0, int Alignment=taDefault)
Draws the given string at coordinates (x, y) with the given foreground and background color and font.
Definition: skincurses.c:142
cSkinCursesDisplayMenu::~cSkinCursesDisplayMenu
virtual ~cSkinCursesDisplayMenu()
Definition: skincurses.c:302
cString::sprintf
static cString sprintf(const char *fmt,...) __attribute__((format(printf
Definition: tools.c:1127
cEvent::ParentalRating
int ParentalRating(void) const
Definition: epg.h:108
tColor
uint32_t tColor
Definition: font.h:29
ChannelString
cString ChannelString(const cChannel *Channel, int Number)
Definition: channels.c:1147
cSkinDisplayChannel
Definition: skins.h:65
cSkinCursesDisplayChannel::osd
cOsd * osd
Definition: skincurses.c:199
isempty
bool isempty(const char *s)
Definition: tools.c:331
cSkinDisplayMenu::GetTabbedText
const char * GetTabbedText(const char *s, int Tab)
Returns the part of the given string that follows the given Tab (where 0 indicates the beginning of t...
Definition: skins.c:112
clrBackground
#define clrBackground
Definition: skincurses.c:36
mcMain
@ mcMain
Definition: skins.h:107
cSkinCursesDisplayTracks::cSkinCursesDisplayTracks
cSkinCursesDisplayTracks(const char *Title, int NumTracks, const char *const *Tracks)
Definition: skincurses.c:653
cSkin
Definition: skins.h:402
clrGreen
#define clrGreen
Definition: skincurses.c:40
cSkinCurses
Definition: skincurses.c:734
cSkinCursesDisplayMenu::Flush
virtual void Flush(void)
Actually draws the OSD display to the output device.
Definition: skincurses.c:492
cCursesOsd::cCursesOsd
cCursesOsd(int Left, int Top)
Definition: skincurses.c:78
cPlugin
Definition: plugin.h:20
cPluginSkinCurses::SetupParse
virtual bool SetupParse(const char *Name, const char *Value)
Definition: skincurses.c:875
cRecordingInfo::Title
const char * Title(void) const
Definition: recording.h:85
cTextScroller::CanScrollUp
bool CanScrollUp(void)
Definition: osd.h:1057
taRight
@ taRight
Definition: osd.h:160
cSkinCursesDisplayMenu::SetText
virtual void SetText(const char *Text, bool FixedFont)
Sets the Text that shall be displayed, using the entire central area of the menu.
Definition: skincurses.c:486
DESCRIPTION
static const char * DESCRIPTION
Definition: skincurses.c:17
trNOOP
#define trNOOP(s)
Definition: i18n.h:88
cRecording::Info
const cRecordingInfo * Info(void) const
Definition: recording.h:153
cSkinCursesDisplayTracks
Definition: skincurses.c:639
cSkinCursesDisplayReplay::SetCurrent
virtual void SetCurrent(const char *Current)
Sets the current position within the recording, as a user readable string if the form "h:mm:ss....
Definition: skincurses.c:560
mcRecording
@ mcRecording
Definition: skins.h:115
clrBlack
#define clrBlack
Definition: skincurses.c:38
cOsd
The cOsd class is the interface to the "On Screen Display".
Definition: osd.h:724
cSkinDisplayMenu::Tab
int Tab(int n)
Returns the offset of the given tab from the left border of the item display area.
Definition: skins.h:174
cSkinCursesDisplayMenu::SetRecording
virtual void SetRecording(const cRecording *Recording)
Sets the Recording that shall be displayed, using the entire central area of the menu.
Definition: skincurses.c:448
cSkinCursesDisplayChannel::Flush
virtual void Flush(void)
Actually draws the OSD display to the output device.
Definition: skincurses.c:258
cSkinDisplayVolume
Definition: skins.h:374
cCursesOsd
Definition: skincurses.c:61
cSkinCursesDisplayReplay::SetMode
virtual void SetMode(bool Play, bool Forward, int Speed)
Sets the current replay mode, which can be used to display some indicator, showing the user whether w...
Definition: skincurses.c:537
cEvent::Contents
uchar Contents(int i=0) const
Definition: epg.h:107
cSkinCursesDisplayReplay::osd
cOsd * osd
Definition: skincurses.c:505
cPluginSkinCurses::ProcessArgs
virtual bool ProcessArgs(int argc, char *argv[])
Definition: skincurses.c:826
cSkinDisplayMenu::MaxTabs
@ MaxTabs
Definition: skins.h:168
cSkinCursesDisplayMenu
Definition: skincurses.c:269
cRecordingInfo::Description
const char * Description(void) const
Definition: recording.h:87
cPluginSkinCurses::MainMenuEntry
virtual const char * MainMenuEntry(void)
Definition: skincurses.c:801
DateString
cString DateString(time_t t)
Converts the given time to a string of the form "www dd.mm.yyyy".
Definition: tools.c:1213
cPluginSkinCurses::Version
virtual const char * Version(void)
Definition: skincurses.c:794
cPluginSkinCurses::~cPluginSkinCurses
virtual ~cPluginSkinCurses()
Definition: skincurses.c:814
tr
#define tr(s)
Definition: i18n.h:85
cCursesOsd::~cCursesOsd
virtual ~cCursesOsd()
Definition: skincurses.c:91
taBottom
@ taBottom
Definition: osd.h:162
cPlugin::Name
const char * Name(void)
Definition: plugin.h:34
cEvent::Title
const char * Title(void) const
Definition: epg.h:103
cVideoDiskUsage::HasChanged
static bool HasChanged(int &State)
Returns true if the usage of the video disk space has changed since the last call to this function wi...
Definition: videodir.c:205
cTextScroller::CanScroll
bool CanScroll(void)
Definition: osd.h:1056
cFont
Definition: font.h:37
cSkinCurses::DisplayChannel
virtual cSkinDisplayChannel * DisplayChannel(bool WithInfo)
Creates and returns a new object for displaying the current channel.
Definition: skincurses.c:756
cSkinCursesDisplayChannel::cSkinCursesDisplayChannel
cSkinCursesDisplayChannel(bool WithInfo)
Definition: skincurses.c:211
cSkinCursesDisplayMenu::MaxItems
virtual int MaxItems(void)
Returns the maximum number of items the menu can display.
Definition: skincurses.c:335
cOsdObject
Definition: osdbase.h:69
cSkinCursesDisplayTracks::osd
cOsd * osd
Definition: skincurses.c:641
cCursesFont::Width
virtual int Width(const char *s) const
Returns the width of the given string in pixel.
Definition: skincurses.c:26
cOsd::SaveRegion
virtual void SaveRegion(int x1, int y1, int x2, int y2)
Saves the region defined by the given coordinates for later restoration through RestoreRegion().
Definition: osd.c:1866
cEvent
Definition: epg.h:71
cTextScroller::Offset
int Offset(void)
Definition: osd.h:1054
cSkinCursesDisplayTracks::SetAudioChannel
virtual void SetAudioChannel(int AudioChannel)
Sets the audio channel indicator.
Definition: skincurses.c:649
cRecordingInfo::ShortText
const char * ShortText(void) const
Definition: recording.h:86
cSkinCursesDisplayReplay
Definition: skincurses.c:503
cSkinCursesDisplayMenu::Scroll
virtual void Scroll(bool Up, bool Page)
If this menu contains a text area that can be scrolled, this function will be called to actually scro...
Definition: skincurses.c:329
Setup
cSetup Setup
Definition: config.c:372
cCursesOsd::RestoreRegion
virtual void RestoreRegion(void)
Restores the region previously saved by a call to SaveRegion().
Definition: skincurses.c:129
cTextScroller::Top
int Top(void)
Definition: osd.h:1050
cCursesOsd::savedRegion
WINDOW * savedRegion
Definition: skincurses.c:63
TimeString
cString TimeString(time_t t)
Converts the given time to a string of the form "hh:mm".
Definition: tools.c:1233
cPluginSkinCurses::MainMenuAction
virtual cOsdObject * MainMenuAction(void)
Definition: skincurses.c:863
cCursesFont::Width
virtual int Width(void) const
Returns the original character width as requested when the font was created, or 0 if the default widt...
Definition: skincurses.c:24
cRecording::Start
time_t Start(void) const
Definition: recording.h:131
cRecordingInfo
Definition: recording.h:63
cSkinCursesDisplayMenu::SetMessage
virtual void SetMessage(eMessageType Type, const char *Text)
Sets a one line message Text, with the given Type.
Definition: skincurses.c:373
cSkinCursesDisplayMenu::SetTextScrollbar
void SetTextScrollbar(void)
Definition: skincurses.c:323
cSkinDisplayMenu::MenuCategory
eMenuCategory MenuCategory(void) const
Returns the menu category, set by a previous call to SetMenuCategory().
Definition: skins.h:183
cSkinCursesDisplayVolume::osd
cOsd * osd
Definition: skincurses.c:597
cSkinCursesDisplayMessage::~cSkinCursesDisplayMessage
virtual ~cSkinCursesDisplayMessage()
Definition: skincurses.c:717
cRecording::Name
const char * Name(void) const
Returns the full name of the recording (without the video directory).
Definition: recording.h:146
cSkinCursesDisplayVolume::SetVolume
virtual void SetVolume(int Current, int Total, bool Mute)
< This class implements the volume/mute display.
Definition: skincurses.c:615
taLeft
@ taLeft
Definition: osd.h:159
cSkinCursesDisplayChannel::SetMessage
virtual void SetMessage(eMessageType Type, const char *Text)
Sets a one line message Text, with the given Type.
Definition: skincurses.c:245
cSkinDisplayMessage
Definition: skins.h:394
cSkinCursesDisplayReplay::SetProgress
virtual void SetProgress(int Current, int Total)
This function will be called whenever the position in or the total length of the recording has change...
Definition: skincurses.c:553
cSkinCurses::DisplayMenu
virtual cSkinDisplayMenu * DisplayMenu(void)
Creates and returns a new object for displaying a menu.
Definition: skincurses.c:761
cSkinCursesDisplayMessage
Definition: skincurses.c:702
cSkinCurses::Description
virtual const char * Description(void)
Returns a user visible, single line description of this skin, which may consist of arbitrary text and...
Definition: skincurses.c:751
cOsd::RestoreRegion
virtual void RestoreRegion(void)
Restores the region previously saved by a call to SaveRegion().
Definition: osd.c:1882
cSkinCursesDisplayMenu::title
cString title
Definition: skincurses.c:272
cSkinCursesDisplayMenu::DrawScrollbar
void DrawScrollbar(int Total, int Offset, int Shown, int Top, int Height, bool CanScrollUp, bool CanScrollDown)
Definition: skincurses.c:307
cSkinCursesDisplayMenu::osd
cOsd * osd
Definition: skincurses.c:271
cPluginSkinCurses::CommandLineHelp
virtual const char * CommandLineHelp(void)
Definition: skincurses.c:820
cCursesFont::DrawText
virtual void DrawText(cPixmap *Pixmap, int x, int y, const char *s, tColor ColorFg, tColor ColorBg, int Width) const
Definition: skincurses.c:29
cVideoDiskUsage::String
static cString String(void)
Returns a localized string of the form "Disk nn% - hh:mm free".
Definition: videodir.c:229
clrCyan
#define clrCyan
Definition: skincurses.c:44
cSkinCursesDisplayMenu::SetScrollbar
virtual void SetScrollbar(int Total, int Offset)
Sets the Total number of items in the currently displayed list, and the Offset of the first item that...
Definition: skincurses.c:405
cSkinCursesDisplayMenu::GetTextAreaFont
virtual const cFont * GetTextAreaFont(bool FixedFont) const
Returns a pointer to the font which is used to display text with SetText().
Definition: skincurses.c:291
cPluginSkinCurses::SetupMenu
virtual cMenuSetupPage * SetupMenu(void)
Definition: skincurses.c:869
cSkinDisplay::SetEditableWidth
void SetEditableWidth(int Width)
If an item is set through a call to cSkinDisplayMenu::SetItem(), this function shall be called to set...
Definition: skins.h:49
cTextScroller::Set
void Set(cOsd *Osd, int Left, int Top, int Width, int Height, const char *Text, const cFont *Font, tColor ColorFg, tColor ColorBg)
Definition: osd.c:2148
cBitmap
Definition: osd.h:169
cSkinDisplayTracks
Definition: skins.h:383
cSkinCursesDisplayMenu::Clear
virtual void Clear(void)
Clears the entire central area of the menu.
Definition: skincurses.c:340
cSkinDisplay::Current
static cSkinDisplay * Current(void)
Returns the currently active cSkinDisplay.
Definition: skins.h:61
cSkin::Name
const char * Name(void)
Definition: skins.h:421
ScOsdHeight
static int ScOsdHeight
Definition: skincurses.c:59
cSetup::ShowReplayMode
int ShowReplayMode
Definition: config.h:344
taCenter
@ taCenter
Definition: osd.h:158
cSkinCurses::cSkinCurses
cSkinCurses(void)
Definition: skincurses.c:746
cPluginSkinCurses::Description
virtual const char * Description(void)
Definition: skincurses.c:795
cSkinCursesDisplayReplay::cSkinCursesDisplayReplay
cSkinCursesDisplayReplay(bool ModeOnly)
Definition: skincurses.c:520
cSkinCursesDisplayMenu::SetButtons
virtual void SetButtons(const char *Red, const char *Green=NULL, const char *Yellow=NULL, const char *Blue=NULL)
Sets the color buttons to the given strings.
Definition: skincurses.c:358
cSkinCursesDisplayMessage::osd
cOsd * osd
Definition: skincurses.c:704
cSkinDisplayMenu::textScroller
cTextScroller textScroller
Definition: skins.h:173
clrRed
#define clrRed
Definition: skincurses.c:39
cTextScroller::Total
int Total(void)
Definition: osd.h:1053
cCursesFont::DrawText
virtual void DrawText(cBitmap *Bitmap, int x, int y, const char *s, tColor ColorFg, tColor ColorBg, int Width) const
Draws the given text into the Bitmap at position (x, y) with the given colors.
Definition: skincurses.c:28
cSkinCursesDisplayReplay::SetTotal
virtual void SetTotal(const char *Total)
Sets the total length of the recording, as a user readable string if the form "h:mm:ss".
Definition: skincurses.c:565
clrBlue
#define clrBlue
Definition: skincurses.c:42
cPluginSkinCurses::cPluginSkinCurses
cPluginSkinCurses(void)
Definition: skincurses.c:807
cRecording
Definition: recording.h:98
cCursesOsd::window
WINDOW * window
Definition: skincurses.c:64
cSkinCursesDisplayVolume
Definition: skincurses.c:595
cPluginSkinCurses
Definition: skincurses.c:788
cPixmap
Definition: osd.h:454
cSkinCursesDisplayMenu::SetEvent
virtual void SetEvent(const cEvent *Event)
Sets the Event that shall be displayed, using the entire central area of the menu.
Definition: skincurses.c:410
VDRPLUGINCREATOR
VDRPLUGINCREATOR(cPluginSkinCurses)
cEvent::StartTime
time_t StartTime(void) const
Definition: epg.h:109
cOsd::Top
int Top(void)
Definition: osd.h:820
cCursesOsd::Flush
virtual void Flush(void)
Actually commits all data to the OSD hardware.
Definition: skincurses.c:190
cEvent::GetParentalRatingString
cString GetParentalRatingString(void) const
Definition: epg.c:421
cPluginSkinCurses::Initialize
virtual bool Initialize(void)
Definition: skincurses.c:832
cEvent::ContentToString
static const char * ContentToString(uchar Content)
Definition: epg.c:279
clrYellow
#define clrYellow
Definition: skincurses.c:41
cSkinDisplayMenu
Definition: skins.h:150
cSkinCursesDisplayChannel::SetChannel
virtual void SetChannel(const cChannel *Channel, int Number)
Sets the current channel to Channel.
Definition: skincurses.c:225
clrMessage
static int clrMessage[]
Definition: skincurses.c:47
cOsd::Left
int Left(void)
Definition: osd.h:819
cOsd::DrawRectangle
virtual void DrawRectangle(int x1, int y1, int x2, int y2, tColor Color)
Draws a filled rectangle defined by the upper left (x1, y1) and lower right (x2, y2) corners with the...
Definition: osd.c:1963
cCursesFont
Definition: skincurses.c:22
cSkinCursesDisplayMenu::SetTitle
virtual void SetTitle(const char *Title)
Sets the title of this menu to Title.
Definition: skincurses.c:352
cSkinDisplayReplay
Definition: skins.h:319
cSetup::ChannelInfoPos
int ChannelInfoPos
Definition: config.h:320
cSkinCursesDisplayReplay::SetJump
virtual void SetJump(const char *Jump)
Sets the prompt that allows the user to enter a jump point.
Definition: skincurses.c:570
cChannel
Definition: channels.h:89
clrWhite
#define clrWhite
Definition: skincurses.c:45
MAINMENUENTRY
static const char * MAINMENUENTRY
Definition: skincurses.c:18
cCursesOsd::SetColor
void SetColor(int colorFg, int colorBg=clrBackground)
Definition: skincurses.c:101
ScOsdWidth
static int ScOsdWidth
Definition: skincurses.c:58
cString
Definition: tools.h:176
cEvent::GetTimeString
cString GetTimeString(void) const
Definition: epg.c:433
cPluginSkinCurses::Housekeeping
virtual void Housekeeping(void)
Definition: skincurses.c:858
cCursesOsd::SaveRegion
virtual void SaveRegion(int x1, int y1, int x2, int y2)
Saves the region defined by the given coordinates for later restoration through RestoreRegion().
Definition: skincurses.c:119
cSkinCursesDisplayTracks::itemsWidth
int itemsWidth
Definition: skincurses.c:642
cTextScroller::Height
int Height(void)
Definition: osd.h:1052
cSkinCursesDisplayVolume::cSkinCursesDisplayVolume
cSkinCursesDisplayVolume(void)
Definition: skincurses.c:605
cTextScroller::Shown
int Shown(void)
Definition: osd.h:1055
cSkinCursesDisplayTracks::SetTrack
virtual void SetTrack(int Index, const char *const *Tracks)
< This class implements the track display.
Definition: skincurses.c:688
cCursesFont::Width
virtual int Width(uint c) const
Returns the width of the given character in pixel.
Definition: skincurses.c:25
cEvent::GetVpsString
cString GetVpsString(void) const
Definition: epg.c:443
clrTransparent
#define clrTransparent
Definition: skincurses.c:37
taTop
@ taTop
Definition: osd.h:161
Skins
cSkins Skins
Definition: skins.c:219
cCursesOsd::colorPairs
int colorPairs[MaxColorPairs]
Definition: skincurses.c:66
cRecordingInfo::ChannelName
const char * ChannelName(void) const
Definition: recording.h:83
cEvent::Vps
time_t Vps(void) const
Definition: epg.h:112
cCursesOsd::DrawRectangle
virtual void DrawRectangle(int x1, int y1, int x2, int y2, tColor Color)
Draws a filled rectangle defined by the upper left (x1, y1) and lower right (x2, y2) corners with the...
Definition: skincurses.c:180
cSkinDisplayMenu::Scroll
virtual void Scroll(bool Up, bool Page)
If this menu contains a text area that can be scrolled, this function will be called to actually scro...
Definition: skins.c:107
cSkinCursesDisplayVolume::Flush
virtual void Flush(void)
Actually draws the OSD display to the output device.
Definition: skincurses.c:632
strn0cpy
char * strn0cpy(char *dest, const char *src, size_t n)
Definition: tools.c:131
VERSION
static const char * VERSION
Definition: skincurses.c:16
cRecordingInfo::GetEvent
const cEvent * GetEvent(void) const
Definition: recording.h:84
cSkinCursesDisplayVolume::~cSkinCursesDisplayVolume
virtual ~cSkinCursesDisplayVolume()
Definition: skincurses.c:610
cEvent::Description
const char * Description(void) const
Definition: epg.h:105
cSkinCursesDisplayTracks::SetItem
void SetItem(const char *Text, int Index, bool Current)
Definition: skincurses.c:672
max
T max(T a, T b)
Definition: tools.h:60
cOsd::Height
int Height(void)
Definition: osd.h:822
cEvent::GetDateString
cString GetDateString(void) const
Definition: epg.c:428
cSkinCursesDisplayReplay::~cSkinCursesDisplayReplay
virtual ~cSkinCursesDisplayReplay()
Definition: skincurses.c:527
cSkinCursesDisplayMessage::SetMessage
virtual void SetMessage(eMessageType Type, const char *Text)
< This class implements a simple message display.
Definition: skincurses.c:722
cEvent::GetEndTimeString
cString GetEndTimeString(void) const
Definition: epg.c:438
cSkinCursesDisplayReplay::message
bool message
Definition: skincurses.c:506
DayDateTime
cString DayDateTime(time_t t)
Converts the given time to a string of the form "www dd.mm. hh:mm".
Definition: tools.c:1192
cOsd::DrawText
virtual void DrawText(int x, int y, const char *s, tColor ColorFg, tColor ColorBg, const cFont *Font, int Width=0, int Height=0, int Alignment=taDefault)
Draws the given string at coordinates (x, y) with the given foreground and background color and font.
Definition: osd.c:1953
cSkinCursesDisplayChannel::SetEvents
virtual void SetEvents(const cEvent *Present, const cEvent *Following)
Sets the Present and Following EPG events.
Definition: skincurses.c:231
cSkinCursesDisplayReplay::SetMessage
virtual void SetMessage(eMessageType Type, const char *Text)
Sets a one line message Text, with the given Type.
Definition: skincurses.c:575
min
T min(T a, T b)
Definition: tools.h:59
cTextScroller::Reset
void Reset(void)
Definition: osd.c:2165
cSkinCursesDisplayTracks::~cSkinCursesDisplayTracks
virtual ~cSkinCursesDisplayTracks()
Definition: skincurses.c:667
cSkinCursesDisplayMenu::DrawTitle
void DrawTitle(void)
Definition: skincurses.c:346
cSkinDisplay::AvgCharWidth
static int AvgCharWidth(void)
Returns the average width of a character in pixel (just a raw estimate).
Definition: skins.h:46
cSkinCursesDisplayChannel::timeWidth
int timeWidth
Definition: skincurses.c:200
cSkinCurses::DisplayVolume
virtual cSkinDisplayVolume * DisplayVolume(void)
Creates and returns a new object for displaying the current volume.
Definition: skincurses.c:771
taDefault
@ taDefault
Definition: osd.h:164
cSkinCursesDisplayMenu::lastDiskUsageState
int lastDiskUsageState
Definition: skincurses.c:273
cSkinCursesDisplayReplay::Flush
virtual void Flush(void)
Actually draws the OSD display to the output device.
Definition: skincurses.c:588
cSkinCursesDisplayChannel
Definition: skincurses.c:197
cSkinCursesDisplayMenu::cSkinCursesDisplayMenu
cSkinCursesDisplayMenu(void)
Definition: skincurses.c:295
cSkinCursesDisplayMessage::cSkinCursesDisplayMessage
cSkinCursesDisplayMessage(void)
Definition: skincurses.c:712
Utf8StrLen
int Utf8StrLen(const char *s)
Returns the number of UTF-8 symbols formed by the given string of character bytes.
Definition: tools.c:869
cCursesFont::Height
virtual int Height(void) const
Returns the height of this font in pixel (all characters have the same height).
Definition: skincurses.c:27
cPluginSkinCurses::Start
virtual bool Start(void)
Definition: skincurses.c:849
cCursesOsd::MaxColorPairs
@ MaxColorPairs
Definition: skincurses.c:65
cMenuSetupPage
Definition: menuitems.h:223
cOsd::Flush
virtual void Flush(void)
Actually commits all data to the OSD hardware.
Definition: osd.c:1993
cOsd::Width
int Width(void)
Definition: osd.h:821
cSkinCurses::DisplayMessage
virtual cSkinDisplayMessage * DisplayMessage(void)
Creates and returns a new object for displaying a message.
Definition: skincurses.c:781
cSkinCurses::DisplayReplay
virtual cSkinDisplayReplay * DisplayReplay(bool ModeOnly)
Creates and returns a new object for displaying replay progress.
Definition: skincurses.c:766
esyslog
#define esyslog(a...)
Definition: tools.h:35
cSkinCursesDisplayMessage::Flush
virtual void Flush(void)
Actually draws the OSD display to the output device.
Definition: skincurses.c:727
eMessageType
eMessageType
Definition: skins.h:37
Font
static const cCursesFont Font
Definition: skincurses.c:32
cSkinCursesDisplayTracks::Flush
virtual void Flush(void)
Actually draws the OSD display to the output device.
Definition: skincurses.c:695
cTextScroller::CanScrollDown
bool CanScrollDown(void)
Definition: osd.h:1058
cEvent::ShortText
const char * ShortText(void) const
Definition: epg.h:104
cSkinCursesDisplayReplay::SetTitle
virtual void SetTitle(const char *Title)
Sets the title of the recording.
Definition: skincurses.c:532
cTextScroller
Definition: osd.h:1035
cSkins::SetCurrent
bool SetCurrent(const char *Name=NULL)
Sets the current skin to the one indicated by name.
Definition: skins.c:231
cSkinCursesDisplayChannel::~cSkinCursesDisplayChannel
virtual ~cSkinCursesDisplayChannel()
Definition: skincurses.c:220