VDR 1.5.4 [PATCH]: skincurses.c doesn't compile

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The attached patch fixes a name clash between skincurses.c and the
new position functions in cOsd.

Guess I should have compiled the plugin once again after having made
this last minute change...

Klaus

--- PLUGINS/src/skincurses/skincurses.c	2007/06/16 09:05:04	1.13
+++ PLUGINS/src/skincurses/skincurses.c	2007/06/17 21:14:08
@@ -51,8 +51,8 @@
   clrRed
   };
 
-static int OsdWidth = 50;
-static int OsdHeight = 20;
+static int SkOsdWidth = 50;
+static int SkOsdHeight = 20;
 
 class cCursesOsd : public cOsd {
 private:
@@ -80,7 +80,7 @@
   start_color();
   leaveok(stdscr, true);
 
-  window = subwin(stdscr, OsdHeight, OsdWidth, 0, 0);
+  window = subwin(stdscr, SkOsdHeight, SkOsdWidth, 0, 0);
   syncok(window, true);
 }
 
@@ -168,7 +168,7 @@
      }
   SetColor(ColorFg, ColorBg);
   wmove(window, y, x); // ncurses wants 'y' before 'x'!
-  waddnstr(window, s, OsdWidth - x);
+  waddnstr(window, s, SkOsdWidth - x);
 }
 
 void cCursesOsd::DrawRectangle(int x1, int y1, int x2, int y2, tColor Color)
@@ -206,9 +206,9 @@
 {
   int Lines = WithInfo ? 5 : 1;
   message = false;
-  osd = new cCursesOsd(0, Setup.ChannelInfoPos ? 0 : OsdHeight - Lines);
+  osd = new cCursesOsd(0, Setup.ChannelInfoPos ? 0 : SkOsdHeight - Lines);
   timeWidth = strlen("00:00");
-  osd->DrawRectangle(0, 0, OsdWidth - 1, Lines - 1, clrBackground);
+  osd->DrawRectangle(0, 0, SkOsdWidth - 1, Lines - 1, clrBackground);
 }
 
 cSkinCursesDisplayChannel::~cSkinCursesDisplayChannel()
@@ -218,14 +218,14 @@
 
 void cSkinCursesDisplayChannel::SetChannel(const cChannel *Channel, int Number)
 {
-  osd->DrawRectangle(0, 0, OsdWidth - 1, 0, clrBackground);
+  osd->DrawRectangle(0, 0, SkOsdWidth - 1, 0, clrBackground);
   osd->DrawText(0, 0, ChannelString(Channel, Number), clrWhite, clrBackground, &Font);
 }
 
 void cSkinCursesDisplayChannel::SetEvents(const cEvent *Present, const cEvent *Following)
 {
   osd->DrawRectangle(0, 1, timeWidth - 1, 4, clrRed);
-  osd->DrawRectangle(timeWidth, 1, OsdWidth - 1, 4, clrBackground);
+  osd->DrawRectangle(timeWidth, 1, SkOsdWidth - 1, 4, clrBackground);
   for (int i = 0; i < 2; i++) {
       const cEvent *e = !i ? Present : Following;
       if (e) {
@@ -239,8 +239,8 @@
 void cSkinCursesDisplayChannel::SetMessage(eMessageType Type, const char *Text)
 {
   if (Text) {
-     osd->SaveRegion(0, 0, OsdWidth - 1, 0);
-     osd->DrawText(0, 0, Text, clrMessage[2 * Type], clrMessage[2 * Type + 1], &Font, OsdWidth, 0, taCenter);
+     osd->SaveRegion(0, 0, SkOsdWidth - 1, 0);
+     osd->DrawText(0, 0, Text, clrMessage[2 * Type], clrMessage[2 * Type + 1], &Font, SkOsdWidth, 0, taCenter);
      message = true;
      }
   else {
@@ -253,7 +253,7 @@
 {
   if (!message) {
      cString date = DayDateTime();
-     osd->DrawText(OsdWidth - Utf8StrLen(date), 0, date, clrWhite, clrBackground, &Font);
+     osd->DrawText(SkOsdWidth - Utf8StrLen(date), 0, date, clrWhite, clrBackground, &Font);
      }
   osd->Flush();
 }
@@ -284,7 +284,7 @@
 cSkinCursesDisplayMenu::cSkinCursesDisplayMenu(void)
 {
   osd = new cCursesOsd(0, 0);
-  osd->DrawRectangle(0, 0, OsdWidth - 1, OsdHeight - 1, clrBackground);
+  osd->DrawRectangle(0, 0, SkOsdWidth - 1, SkOsdHeight - 1, clrBackground);
 }
 
 cSkinCursesDisplayMenu::~cSkinCursesDisplayMenu()
@@ -301,7 +301,7 @@
      int sb = yb;
      int tt = st + (sb - st) * textScroller.Offset() / textScroller.Total();
      int tb = tt + (sb - st) * textScroller.Shown() / textScroller.Total();
-     int xl = OsdWidth - 1;
+     int xl = SkOsdWidth - 1;
      osd->DrawRectangle(xl, st, xl, sb, clrCyan);
      osd->DrawRectangle(xl, tt, xl, tb, clrWhite);
      }
@@ -315,29 +315,29 @@
 
 int cSkinCursesDisplayMenu::MaxItems(void)
 {
-  return OsdHeight - 4;
+  return SkOsdHeight - 4;
 }
 
 void cSkinCursesDisplayMenu::Clear(void)
 {
-  osd->DrawRectangle(0, 1, OsdWidth - 1, OsdHeight - 2, clrBackground);
+  osd->DrawRectangle(0, 1, SkOsdWidth - 1, SkOsdHeight - 2, clrBackground);
   textScroller.Reset();
 }
 
 void cSkinCursesDisplayMenu::SetTitle(const char *Title)
 {
-  osd->DrawText(0, 0, Title, clrBlack, clrCyan, &Font, OsdWidth);
+  osd->DrawText(0, 0, Title, clrBlack, clrCyan, &Font, SkOsdWidth);
 }
 
 void cSkinCursesDisplayMenu::SetButtons(const char *Red, const char *Green, const char *Yellow, const char *Blue)
 {
-  int w = OsdWidth;
+  int w = SkOsdWidth;
   int t0 = 0;
   int t1 = 0 + w / 4;
   int t2 = 0 + w / 2;
   int t3 = w - w / 4;
   int t4 = w;
-  int y = OsdHeight - 1;
+  int y = SkOsdHeight - 1;
   osd->DrawText(t0, y, Red,    clrWhite, Red    ? clrRed    : clrBackground, &Font, t1 - t0, 0, taCenter);
   osd->DrawText(t1, y, Green,  clrBlack, Green  ? clrGreen  : clrBackground, &Font, t2 - t1, 0, taCenter);
   osd->DrawText(t2, y, Yellow, clrBlack, Yellow ? clrYellow : clrBackground, &Font, t3 - t2, 0, taCenter);
@@ -347,9 +347,9 @@
 void cSkinCursesDisplayMenu::SetMessage(eMessageType Type, const char *Text)
 {
   if (Text)
-     osd->DrawText(0, OsdHeight - 2, Text, clrMessage[2 * Type], clrMessage[2 * Type + 1], &Font, OsdWidth, 0, taCenter);
+     osd->DrawText(0, SkOsdHeight - 2, Text, clrMessage[2 * Type], clrMessage[2 * Type + 1], &Font, SkOsdWidth, 0, taCenter);
   else
-     osd->DrawRectangle(0, OsdHeight - 2, OsdWidth - 1, OsdHeight - 2, clrBackground);
+     osd->DrawRectangle(0, SkOsdHeight - 2, SkOsdWidth - 1, SkOsdHeight - 2, clrBackground);
 }
 
 void cSkinCursesDisplayMenu::SetItem(const char *Text, int Index, bool Current, bool Selectable)
@@ -368,12 +368,12 @@
       const char *s = GetTabbedText(Text, i);
       if (s) {
          int xt = Tab(i) / 12;// Tab() is in "pixel" - see also skins.c!!!
-         osd->DrawText(xt, y, s, ColorFg, ColorBg, &Font, OsdWidth - xt);
+         osd->DrawText(xt, y, s, ColorFg, ColorBg, &Font, SkOsdWidth - xt);
          }
       if (!Tab(i + 1))
          break;
       }
-  SetEditableWidth(OsdWidth - Tab(1) / 12); // Tab() is in "pixel" - see also skins.c!!!
+  SetEditableWidth(SkOsdWidth - Tab(1) / 12); // Tab() is in "pixel" - see also skins.c!!!
 }
 
 void cSkinCursesDisplayMenu::SetEvent(const cEvent *Event)
@@ -384,24 +384,24 @@
   cTextScroller ts;
   char t[32];
   snprintf(t, sizeof(t), "%s  %s - %s", *Event->GetDateString(), *Event->GetTimeString(), *Event->GetEndTimeString());
-  ts.Set(osd, 0, y, OsdWidth, OsdHeight - y - 2, t, &Font, clrYellow, clrBackground);
+  ts.Set(osd, 0, y, SkOsdWidth, SkOsdHeight - y - 2, t, &Font, clrYellow, clrBackground);
   if (Event->Vps() && Event->Vps() != Event->StartTime()) {
      char *buffer;
      asprintf(&buffer, " VPS: %s", *Event->GetVpsString());
-     osd->DrawText(OsdWidth - Utf8StrLen(buffer), y, buffer, clrBlack, clrYellow, &Font);
+     osd->DrawText(SkOsdWidth - Utf8StrLen(buffer), y, buffer, clrBlack, clrYellow, &Font);
      free(buffer);
      }
   y += ts.Height();
   y += 1;
-  ts.Set(osd, 0, y, OsdWidth, OsdHeight - y - 2, Event->Title(), &Font, clrCyan, clrBackground);
+  ts.Set(osd, 0, y, SkOsdWidth, SkOsdHeight - y - 2, Event->Title(), &Font, clrCyan, clrBackground);
   y += ts.Height();
   if (!isempty(Event->ShortText())) {
-     ts.Set(osd, 0, y, OsdWidth, OsdHeight - y - 2, Event->ShortText(), &Font, clrYellow, clrBackground);
+     ts.Set(osd, 0, y, SkOsdWidth, SkOsdHeight - y - 2, Event->ShortText(), &Font, clrYellow, clrBackground);
      y += ts.Height();
      }
   y += 1;
   if (!isempty(Event->Description())) {
-     textScroller.Set(osd, 0, y, OsdWidth - 2, OsdHeight - y - 2, Event->Description(), &Font, clrCyan, clrBackground);
+     textScroller.Set(osd, 0, y, SkOsdWidth - 2, SkOsdHeight - y - 2, Event->Description(), &Font, clrCyan, clrBackground);
      SetScrollbar();
      }
 }
@@ -415,35 +415,35 @@
   cTextScroller ts;
   char t[32];
   snprintf(t, sizeof(t), "%s  %s", *DateString(Recording->start), *TimeString(Recording->start));
-  ts.Set(osd, 0, y, OsdWidth, OsdHeight - y - 2, t, &Font, clrYellow, clrBackground);
+  ts.Set(osd, 0, y, SkOsdWidth, SkOsdHeight - y - 2, t, &Font, clrYellow, clrBackground);
   y += ts.Height();
   y += 1;
   const char *Title = Info->Title();
   if (isempty(Title))
      Title = Recording->Name();
-  ts.Set(osd, 0, y, OsdWidth, OsdHeight - y - 2, Title, &Font, clrCyan, clrBackground);
+  ts.Set(osd, 0, y, SkOsdWidth, SkOsdHeight - y - 2, Title, &Font, clrCyan, clrBackground);
   y += ts.Height();
   if (!isempty(Info->ShortText())) {
-     ts.Set(osd, 0, y, OsdWidth, OsdHeight - y - 2, Info->ShortText(), &Font, clrYellow, clrBackground);
+     ts.Set(osd, 0, y, SkOsdWidth, SkOsdHeight - y - 2, Info->ShortText(), &Font, clrYellow, clrBackground);
      y += ts.Height();
      }
   y += 1;
   if (!isempty(Info->Description())) {
-     textScroller.Set(osd, 0, y, OsdWidth - 2, OsdHeight - y - 2, Info->Description(), &Font, clrCyan, clrBackground);
+     textScroller.Set(osd, 0, y, SkOsdWidth - 2, SkOsdHeight - y - 2, Info->Description(), &Font, clrCyan, clrBackground);
      SetScrollbar();
      }
 }
 
 void cSkinCursesDisplayMenu::SetText(const char *Text, bool FixedFont)
 {
-  textScroller.Set(osd, 0, 2, OsdWidth - 2, OsdHeight - 4, Text, &Font, clrWhite, clrBackground);
+  textScroller.Set(osd, 0, 2, SkOsdWidth - 2, SkOsdHeight - 4, Text, &Font, clrWhite, clrBackground);
   SetScrollbar();
 }
 
 void cSkinCursesDisplayMenu::Flush(void)
 {
   cString date = DayDateTime();
-  osd->DrawText(OsdWidth - Utf8StrLen(date) - 2, 0, date, clrBlack, clrCyan, &Font);
+  osd->DrawText(SkOsdWidth - Utf8StrLen(date) - 2, 0, date, clrBlack, clrCyan, &Font);
   osd->Flush();
 }
 
@@ -469,8 +469,8 @@
 cSkinCursesDisplayReplay::cSkinCursesDisplayReplay(bool ModeOnly)
 {
   message = false;
-  osd = new cCursesOsd(0, OsdHeight - 3);
-  osd->DrawRectangle(0, 0, OsdWidth - 1, 2, ModeOnly ? clrTransparent : clrBackground);
+  osd = new cCursesOsd(0, SkOsdHeight - 3);
+  osd->DrawRectangle(0, 0, SkOsdWidth - 1, 2, ModeOnly ? clrTransparent : clrBackground);
 }
 
 cSkinCursesDisplayReplay::~cSkinCursesDisplayReplay()
@@ -480,7 +480,7 @@
 
 void cSkinCursesDisplayReplay::SetTitle(const char *Title)
 {
-  osd->DrawText(0, 0, Title, clrWhite, clrBackground, &Font, OsdWidth);
+  osd->DrawText(0, 0, Title, clrWhite, clrBackground, &Font, SkOsdWidth);
 }
 
 void cSkinCursesDisplayReplay::SetMode(bool Play, bool Forward, int Speed)
@@ -501,9 +501,9 @@
 
 void cSkinCursesDisplayReplay::SetProgress(int Current, int Total)
 {
-  int p = Total > 0 ? OsdWidth * Current / Total : 0;
+  int p = Total > 0 ? SkOsdWidth * Current / Total : 0;
   osd->DrawRectangle(0, 1, p, 1, clrGreen);
-  osd->DrawRectangle(p, 1, OsdWidth, 1, clrWhite);
+  osd->DrawRectangle(p, 1, SkOsdWidth, 1, clrWhite);
 }
 
 void cSkinCursesDisplayReplay::SetCurrent(const char *Current)
@@ -513,19 +513,19 @@
 
 void cSkinCursesDisplayReplay::SetTotal(const char *Total)
 {
-  osd->DrawText(OsdWidth - Utf8StrLen(Total), 2, Total, clrWhite, clrBackground, &Font);
+  osd->DrawText(SkOsdWidth - Utf8StrLen(Total), 2, Total, clrWhite, clrBackground, &Font);
 }
 
 void cSkinCursesDisplayReplay::SetJump(const char *Jump)
 {
-  osd->DrawText(OsdWidth / 4, 2, Jump, clrWhite, clrBackground, &Font, OsdWidth / 2, 0, taCenter);
+  osd->DrawText(SkOsdWidth / 4, 2, Jump, clrWhite, clrBackground, &Font, SkOsdWidth / 2, 0, taCenter);
 }
 
 void cSkinCursesDisplayReplay::SetMessage(eMessageType Type, const char *Text)
 {
   if (Text) {
-     osd->SaveRegion(0, 2, OsdWidth - 1, 2);
-     osd->DrawText(0, 2, Text, clrMessage[2 * Type], clrMessage[2 * Type + 1], &Font, OsdWidth, 0, taCenter);
+     osd->SaveRegion(0, 2, SkOsdWidth - 1, 2);
+     osd->DrawText(0, 2, Text, clrMessage[2 * Type], clrMessage[2 * Type + 1], &Font, SkOsdWidth, 0, taCenter);
      message = true;
      }
   else {
@@ -553,7 +553,7 @@
 
 cSkinCursesDisplayVolume::cSkinCursesDisplayVolume(void)
 {
-  osd = new cCursesOsd(0, OsdHeight - 1);
+  osd = new cCursesOsd(0, SkOsdHeight - 1);
 }
 
 cSkinCursesDisplayVolume::~cSkinCursesDisplayVolume()
@@ -564,16 +564,16 @@
 void cSkinCursesDisplayVolume::SetVolume(int Current, int Total, bool Mute)
 {
   if (Mute) {
-     osd->DrawRectangle(0, 0, OsdWidth - 1, 0, clrTransparent);
+     osd->DrawRectangle(0, 0, SkOsdWidth - 1, 0, clrTransparent);
      osd->DrawText(0, 0, tr("Key$Mute"), clrGreen, clrBackground, &Font);
      }
   else {
      const char *Prompt = tr("Volume ");
      int l = Utf8StrLen(Prompt);
-     int p = (OsdWidth - l) * Current / Total;
+     int p = (SkOsdWidth - l) * Current / Total;
      osd->DrawText(0, 0, Prompt, clrGreen, clrBackground, &Font);
      osd->DrawRectangle(l, 0, l + p - 1, 0, clrGreen);
-     osd->DrawRectangle(l + p, 0, OsdWidth - 1, 0, clrWhite);
+     osd->DrawRectangle(l + p, 0, SkOsdWidth - 1, 0, clrWhite);
      }
 }
 
@@ -604,9 +604,9 @@
   itemsWidth = Font.Width(Title);
   for (int i = 0; i < NumTracks; i++)
       itemsWidth = max(itemsWidth, Font.Width(Tracks[i]));
-  itemsWidth = min(itemsWidth, OsdWidth);
+  itemsWidth = min(itemsWidth, SkOsdWidth);
   osd = new cCursesOsd(0, 0);
-  osd->DrawRectangle(0, 0, OsdWidth - 1, OsdHeight - 1, clrBackground);
+  osd->DrawRectangle(0, 0, SkOsdWidth - 1, SkOsdHeight - 1, clrBackground);
   osd->DrawText(0, 0, Title, clrBlack, clrCyan, &Font, itemsWidth);
   for (int i = 0; i < NumTracks; i++)
       SetItem(Tracks[i], i, false);
@@ -659,7 +659,7 @@
 
 cSkinCursesDisplayMessage::cSkinCursesDisplayMessage(void)
 {
-  osd = new cCursesOsd(0, OsdHeight - 1);
+  osd = new cCursesOsd(0, SkOsdHeight - 1);
 }
 
 cSkinCursesDisplayMessage::~cSkinCursesDisplayMessage()
@@ -669,7 +669,7 @@
 
 void cSkinCursesDisplayMessage::SetMessage(eMessageType Type, const char *Text)
 {
-  osd->DrawText(0, 0, Text, clrMessage[2 * Type], clrMessage[2 * Type + 1], &Font, OsdWidth, 0, taCenter);
+  osd->DrawText(0, 0, Text, clrMessage[2 * Type], clrMessage[2 * Type + 1], &Font, SkOsdWidth, 0, taCenter);
 }
 
 void cSkinCursesDisplayMessage::Flush(void)
@@ -782,8 +782,8 @@
   // Initialize any background activities the plugin shall perform.
   WINDOW *w = initscr();
   if (w) {
-     OsdWidth  = w->_maxx - w->_begx + 1;
-     OsdHeight = w->_maxy - w->_begy + 1;
+     SkOsdWidth  = w->_maxx - w->_begx + 1;
+     SkOsdHeight = w->_maxy - w->_begy + 1;
      return true;
      }
   return false;
_______________________________________________
vdr mailing list
vdr@xxxxxxxxxxx
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr

[Index of Archives]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Util Linux NG]     [Xfree86]     [Big List of Linux Books]     [Fedora Users]     [Fedora Women]     [ALSA Devel]     [Linux USB]

  Powered by Linux