コード例 #1
0
void cSkinSTTNGDisplayMenu::SetItem(const char *Text, int Index, bool Current, bool Selectable)
{
  int y = y3 + Roundness + Index * lineHeight;
  tColor ColorFg, ColorBg;
  if (Current) {
     ColorFg = Theme.Color(clrMenuItemCurrentFg);
     ColorBg = Theme.Color(clrMenuItemCurrentBg);
     osd->DrawEllipse  (x1, y - Roundness,  x2 - 1, y - 1, frameColor, -3);
     osd->DrawRectangle(x1, y,              x2 - 1, y + lineHeight - 1, frameColor);
     osd->DrawEllipse  (x1, y + lineHeight, x2 - 1, y + lineHeight + Roundness - 1, frameColor, -2);
     osd->DrawRectangle(x3, y,              x4 - 1, y + lineHeight - 1, ColorBg);
     currentIndex = Index;
     }
  else {
     ColorFg = Theme.Color(Selectable ? clrMenuItemSelectable : clrMenuItemNonSelectable);
     ColorBg = Theme.Color(clrBackground);
     if (currentIndex == Index) {
        osd->DrawRectangle(x1, y - Roundness,  x2 - 1, y + lineHeight + Roundness - 1, Theme.Color(clrBackground));
        osd->DrawRectangle(x3, y,              x4 - 1, y + lineHeight - 1, Theme.Color(clrBackground));
        }
     }
  const cFont *font = cFont::GetFont(fontOsd);
  for (int i = 0; i < MaxTabs; i++) {
      const char *s = GetTabbedText(Text, i);
      if (s) {
         int xt = x3 + 5 + Tab(i);
         osd->DrawText(xt, y, s, ColorFg, ColorBg, font, x4 - xt);
         }
      if (!Tab(i + 1))
         break;
      }
  SetEditableWidth(x4 - x3 - 5 - Tab(1));
}
コード例 #2
0
ファイル: skinclassic.c プロジェクト: Moorviper/zen2vdr
cSkinClassicDisplayTracks::cSkinClassicDisplayTracks(const char *Title, int NumTracks, const char * const *Tracks)
{
  const cFont *font = cFont::GetFont(fontOsd);
  lineHeight = font->Height();
  currentIndex = -1;
  int ItemsWidth = font->Width(Title);
  for (int i = 0; i < NumTracks; i++)
      ItemsWidth = max(ItemsWidth, font->Width(Tracks[i]));
  ItemsWidth += 2 * TextSpacing;
  x0 = 0;
  x1 = cOsd::OsdWidth();
  int d = x1 - x0;
  if (d > ItemsWidth) {
     d = (d - ItemsWidth) & ~0x07; // must be multiple of 8
     x1 -= d;
     }
  y0 = 0;
  y1 = lineHeight;
  y2 = y1 + NumTracks * lineHeight;
  osd = cOsdProvider::NewOsd(cOsd::OsdLeft(), cOsd::OsdTop() + cOsd::OsdHeight() - y2);
  tArea Areas[] = { { x0, y0, x1 - 1, y2 - 1, 8 } };
  if (Setup.AntiAlias && osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk)
     osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
  else {
     tArea Areas[] = { { x0, y0, x1 - 1, y2 - 1, 4 } };
     osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
     }
  osd->DrawText(x0, y0, Title, Theme.Color(clrMenuTitleFg), Theme.Color(clrMenuTitleBg), font, x1 - x0);
  for (int i = 0; i < NumTracks; i++)
      SetItem(Tracks[i], i, false);
}
コード例 #3
0
ファイル: skinclassic.c プロジェクト: Moorviper/zen2vdr
void cSkinClassicDisplayReplay::SetCurrent(const char *Current)
{
  const cFont *font = cFont::GetFont(fontOsd);
  int w = font->Width(Current);
  osd->DrawText(x0, y2, Current, Theme.Color(clrReplayCurrent), Theme.Color(clrBackground), font, lastCurrentWidth > w ? lastCurrentWidth : w);
  lastCurrentWidth = w;
}
コード例 #4
0
void cSkinSTTNGDisplayVolume::SetVolume(int Current, int Total, bool Mute)
{
  int xl = x3 + 5;
  int xr = x4 - 5;
  int yt = y0 + 3;
  int yb = y1 - 3;
  if (mute != Mute) {
     osd->DrawRectangle(x3, y0, x4 - 1, y1 - 1, frameColor);
     mute = Mute;
     }
  cBitmap bm(Mute ? mute_xpm : volume_xpm);
  osd->DrawBitmap(xl, y0 + (y1 - y0 - bm.Height()) / 2, bm, Theme.Color(clrVolumeSymbol), frameColor);
  if (!Mute) {
     xl += bm.Width() + 5;
     int w = (y1 - y0) / 3;
     int d = 3;
     int n = (xr - xl + d) / (w + d);
     int x = xr - n * (w + d);
     tColor Color = Theme.Color(clrVolumeBarLower);
     for (int i = 0; i < n; i++) {
         if (Total * i >= Current * n)
            Color = Theme.Color(clrVolumeBarUpper);
         osd->DrawRectangle(x, yt, x + w - 1, yb - 1, Color);
         x += w + d;
         }
     }
}
コード例 #5
0
void cSkinSTTNGDisplayChannel::Flush(void)
{
  if (withInfo) {
     if (!message) {
        const cFont *font = cFont::GetFont(fontSml);
        cString date = DayDateTime();
        int w = font->Width(date);
        osd->DrawText(x4 - w - 2, y7 - font->Height(date), date, Theme.Color(clrChannelDate), frameColor, font);
        cDevice *Device = cDevice::PrimaryDevice();
        const tTrackId *Track = Device->GetTrack(Device->GetCurrentAudioTrack());
        if (!Track && *lastTrackId.description || Track && strcmp(lastTrackId.description, Track->description)) {
           osd->DrawText(x3 + 2, y6, Track ? Track->description : "", Theme.Color(clrChannelName), frameColor, font, x4 - x3 - w - 4);
           strn0cpy(lastTrackId.description, Track ? Track->description : "", sizeof(lastTrackId.description));
           }
        }

     int seen = 0;
     if (present) {
        time_t t = time(NULL);
        if (t > present->StartTime())
           seen = min(y4 - y3 - 1, int((y4 - y3) * double(t - present->StartTime()) / present->Duration()));
        }
     if (seen != lastSeen) {
        osd->DrawRectangle(x1 + Gap, y3, x1 + Gap + ScrollWidth - 1, y4 - 1, Theme.Color(clrChannelTimebarRest));
        if (seen)
        osd->DrawRectangle(x1 + Gap, y3, x1 + Gap + ScrollWidth - 1, y3 + seen, Theme.Color(clrChannelTimebarSeen));
        lastSeen = seen;
        }
     }
  osd->Flush();
}
コード例 #6
0
void cSkinSTTNGDisplayTracks::SetItem(const char *Text, int Index, bool Current)
{
  int y = y3 + Roundness + Index * lineHeight;
  tColor ColorFg, ColorBg;
  if (Current) {
     ColorFg = Theme.Color(clrMenuItemCurrentFg);
     ColorBg = Theme.Color(clrMenuItemCurrentBg);
     osd->DrawEllipse  (x1, y - Roundness,  x2 - 1, y - 1, frameColor, -3);
     osd->DrawRectangle(x1, y,              x2 - 1, y + lineHeight - 1, frameColor);
     osd->DrawEllipse  (x1, y + lineHeight, x2 - 1, y + lineHeight + Roundness - 1, frameColor, -2);
     osd->DrawRectangle(x3, y,              x4 - 1, y + lineHeight - 1, ColorBg);
     currentIndex = Index;
     }
  else {
     ColorFg = Theme.Color(clrMenuItemSelectable);
     ColorBg = Theme.Color(clrBackground);
     if (currentIndex == Index) {
        osd->DrawRectangle(x1, y - Roundness,  x2 - 1, y + lineHeight + Roundness - 1, Theme.Color(clrBackground));
        osd->DrawRectangle(x3, y,              x4 - 1, y + lineHeight - 1, Theme.Color(clrBackground));
        }
     }
  const cFont *font = cFont::GetFont(fontOsd);
  int xt = x3 + 5;
  osd->DrawText(xt, y, Text, ColorFg, ColorBg, font, x4 - xt);
}
コード例 #7
0
ファイル: skinclassic.c プロジェクト: Moorviper/zen2vdr
void cSkinClassicDisplayMenu::SetMessage(eMessageType Type, const char *Text)
{
  const cFont *font = cFont::GetFont(fontOsd);
  if (Text)
     osd->DrawText(x0, y3, Text, Theme.Color(clrMessageStatusFg + 2 * Type), Theme.Color(clrMessageStatusBg + 2 * Type), font, x3 - x0, 0, taCenter);
  else
     osd->DrawRectangle(x0, y3, x3 - 1, y4 - 1, Theme.Color(clrBackground));
}
コード例 #8
0
cSkinSTTNGDisplayMenu::cSkinSTTNGDisplayMenu(void)
{
  const cFont *font = cFont::GetFont(fontOsd);
  lineHeight = font->Height();
  frameColor = Theme.Color(clrMenuFrame);
  currentIndex = -1;
  message = false;
  x0 = 0;
  x1 = lineHeight / 2;
  x3 = (x1 + Roundness + Gap + 7) & ~0x07; // must be multiple of 8
  x2 = x3 - Gap;
  x7 = Setup.OSDWidth;
  x6 = x7 - lineHeight / 2;
  x4 = (x6 - lineHeight / 2 - Gap) & ~0x07; // must be multiple of 8
  x5 = x4 + Gap;
  y0 = 0;
  y1 = lineHeight;
  y2 = y1 + Roundness;
  y3 = y2 + Gap;
  y7 = Setup.OSDHeight;
  y6 = y7 - cFont::GetFont(fontSml)->Height();
  y5 = y6 - Roundness;
  y4 = y5 - Gap;
  int yt = (y0 + y1) / 2;
  int yb = (y6 + y7) / 2;
  osd = cOsdProvider::NewOsd(Setup.OSDLeft, Setup.OSDTop);
  tArea Areas[] = { { x0, y0, x7 - 1, y7 - 1, 4 } };
  if (osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk)
     osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
  else {
     tArea Areas[] = { { x0, y0, x7 - 1, y3 - 1, 2 },
                       { x0, y3, x3 - 1, y4 - 1, 1 },
                       { x3, y3, x4 - 1, y4 - 1, 2 },
                       { x4, y3, x7 - 1, y4 - 1, 2 },
                       { x0, y4, x7 - 1, y7 - 1, 4 }
                     };
     osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
     }
  osd->DrawRectangle(x0, y0, x7 - 1, y7 - 1, Theme.Color(clrBackground));
  osd->DrawRectangle(x0, y0, x1 - 1, y1 - 1, clrTransparent);
  osd->DrawRectangle(x0, y6, x1 - 1, y7 - 1, clrTransparent);
  osd->DrawRectangle(x6, y0, x7 - 1, yt - 1, clrTransparent);
  osd->DrawRectangle(x6, yb, x7 - 1, y7 - 1, clrTransparent);
  osd->DrawEllipse  (x0, y0, x1 - 1, y1 - 1, frameColor, 2);
  osd->DrawRectangle(x1, y0, x2 - 1, y1 - 1, frameColor);
  osd->DrawRectangle(x3, y0, x4 - 1, y1 - 1, frameColor);
  osd->DrawRectangle(x5, y0, x6 - 1, y1 - 1, frameColor);
  osd->DrawEllipse  (x6, y0, x7 - 1, y1 - 1, frameColor, 5);
  osd->DrawRectangle(x0, y1, x1 - 1, y6 - 1, frameColor);
  osd->DrawEllipse  (x1, y1, x2 - 1, y2 - 1, frameColor, -2);
  osd->DrawEllipse  (x1, y5, x2 - 1, y6 - 1, frameColor, -3);
  osd->DrawEllipse  (x0, y6, x1 - 1, y7 - 1, frameColor, 3);
  osd->DrawRectangle(x1, y6, x2 - 1, y7 - 1, frameColor);
  osd->DrawRectangle(x3, y6, x4 - 1, y7 - 1, frameColor);
  osd->DrawRectangle(x5, y6, x6 - 1, y7 - 1, frameColor);
  osd->DrawEllipse  (x6, y6, x7 - 1, y7 - 1, frameColor, 5);
}
コード例 #9
0
ファイル: skinclassic.c プロジェクト: Moorviper/zen2vdr
void cSkinClassicDisplayReplay::SetMessage(eMessageType Type, const char *Text)
{
  const cFont *font = cFont::GetFont(fontOsd);
  if (Text) {
     osd->SaveRegion(x0, y2, x1 - 1, y3 - 1);
     osd->DrawText(x0, y2, Text, Theme.Color(clrMessageStatusFg + 2 * Type), Theme.Color(clrMessageStatusBg + 2 * Type), font, x1 - x0, y3 - y2, taCenter);
     }
  else
     osd->RestoreRegion();
}
コード例 #10
0
void cSkinSTTNGDisplayReplay::SetMessage(eMessageType Type, const char *Text)
{
  const cFont *font = cFont::GetFont(fontSml);
  if (Text) {
     osd->SaveRegion(x2, y6, x4 - 1, y7 - 1);
     osd->DrawRectangle(x2, y6, x3 - 1, y7 - 1, Theme.Color(clrBackground));
     osd->DrawText(x3, y6, Text, Theme.Color(clrMessageStatusFg + 2 * Type), Theme.Color(clrMessageStatusBg + 2 * Type), font, x4 - x3, 0, taCenter);
     }
  else
     osd->RestoreRegion();
}
コード例 #11
0
ファイル: skinclassic.c プロジェクト: Moorviper/zen2vdr
void cSkinClassicDisplayMenu::Flush(void)
{
  cString date = DayDateTime();
  if (!*lastDate || strcmp(date, lastDate)) {
     const cFont *font = cFont::GetFont(fontOsd);
     int w = font->Width(date);
     osd->DrawText(x3 - w - TextFrame, y0, date, Theme.Color(clrMenuDate), Theme.Color(clrMenuTitleBg), font, w);
     lastDate = date;
     dateWidth = max(w + TextFrame, dateWidth);
     }
  osd->Flush();
}
コード例 #12
0
ファイル: skinclassic.c プロジェクト: Moorviper/zen2vdr
void cSkinClassicDisplayChannel::SetEvents(const cEvent *Present, const cEvent *Following)
{
  osd->DrawRectangle(0, lineHeight, timeWidth - 1, osd->Height(), Theme.Color(clrChannelEpgTimeBg));
  osd->DrawRectangle(timeWidth, lineHeight, osd->Width() - 1, osd->Height(), Theme.Color(clrBackground));
  for (int i = 0; i < 2; i++) {
      const cEvent *e = !i ? Present : Following;
      if (e) {
         osd->DrawText(                  TextFrame, (2 * i + 1) * lineHeight, e->GetTimeString(), Theme.Color(clrChannelEpgTimeFg), Theme.Color(clrChannelEpgTimeBg), cFont::GetFont(fontOsd));
         osd->DrawText(timeWidth + 2 * TextSpacing, (2 * i + 1) * lineHeight, e->Title(), Theme.Color(clrChannelEpgTitle), Theme.Color(clrBackground), cFont::GetFont(fontOsd));
         osd->DrawText(timeWidth + 2 * TextSpacing, (2 * i + 2) * lineHeight, e->ShortText(), Theme.Color(clrChannelEpgShortText), Theme.Color(clrBackground), cFont::GetFont(fontSml));
         }
      }
}
コード例 #13
0
ファイル: skinclassic.c プロジェクト: Moorviper/zen2vdr
void cSkinClassicDisplayChannel::SetMessage(eMessageType Type, const char *Text)
{
  const cFont *font = cFont::GetFont(fontOsd);
  if (Text) {
     osd->SaveRegion(0, 0, osd->Width() - 1, lineHeight - 1);
     osd->DrawText(0, 0, Text, Theme.Color(clrMessageStatusFg + 2 * Type), Theme.Color(clrMessageStatusBg + 2 * Type), font, osd->Width(), 0, taCenter);
     message = true;
     }
  else {
     osd->RestoreRegion();
     message = false;
     }
}
コード例 #14
0
void cSkinSTTNGDisplayMenu::SetMessage(eMessageType Type, const char *Text)
{
  const cFont *font = cFont::GetFont(fontSml);
  if (Text) {
     osd->SaveRegion(x3, y6, x4 - 1, y7 - 1);
     osd->DrawText(x3, y6, Text, Theme.Color(clrMessageStatusFg + 2 * Type), Theme.Color(clrMessageStatusBg + 2 * Type), font, x4 - x3, 0, taCenter);
     message = true;
     }
  else {
     osd->RestoreRegion();
     message = false;
     }
}
コード例 #15
0
cSkinSTTNGDisplayReplay::cSkinSTTNGDisplayReplay(bool ModeOnly)
{
  const cFont *font = cFont::GetFont(fontSml);
  int lineHeight = font->Height();
  frameColor = Theme.Color(clrReplayFrame);
  lastCurrentWidth = 0;
  cBitmap bm(play_xpm);
  x0 = 0;
  x1 = max(SymbolWidth, bm.Width());
  x2 = x1 + Roundness;
  x3 = x2 + Gap;
  x7 = Setup.OSDWidth;
  x6 = x7 - lineHeight / 2;
  x5 = x6 - lineHeight / 2;
  x4 = x5 - Gap;
  y0 = 0;
  y1 = lineHeight;
  y2 = y1 + Roundness;
  y3 = y2 + Gap;
  y4 = y3 + max(SymbolHeight, bm.Height());
  y5 = y4 + Gap;
  y6 = y5 + Roundness;
  y7 = y6 + font->Height();
  int yt = (y0 + y1) / 2;
  int yb = (y6 + y7) / 2;
  osd = cOsdProvider::NewOsd(Setup.OSDLeft, Setup.OSDTop + Setup.OSDHeight - y7);
  tArea Areas[] = { { 0, 0, x7 - 1, y7 - 1, 4 } };
  osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
  osd->DrawRectangle(x0, y0, x7 - 1, y7 - 1, ModeOnly ? clrTransparent : Theme.Color(clrBackground));
  if (!ModeOnly) {
     osd->DrawRectangle(x0, y0, x1 - 1, y1 - 1, clrTransparent);
     osd->DrawRectangle(x0, y6, x1 - 1, y7 - 1, clrTransparent);
     osd->DrawRectangle(x6, y0, x7 - 1, yt - 1, clrTransparent);
     osd->DrawRectangle(x6, yb, x7 - 1, y7 - 1, clrTransparent);
     osd->DrawEllipse  (x0, y0, x1 - 1, y1 - 1, frameColor, 2);
     osd->DrawRectangle(x1, y0, x4 - 1, y1 - 1, frameColor);
     osd->DrawRectangle(x5, y0, x6 - 1, y1 - 1, frameColor);
     osd->DrawEllipse  (x6, y0, x7 - 1, y1 - 1, frameColor, 5);
     osd->DrawRectangle(x0, y1, x1 - 1, y2 - 1, frameColor);
     osd->DrawEllipse  (x1, y1, x2 - 1, y2 - 1, frameColor, -2);
     }
  osd->DrawRectangle(x0, y3, x1 - 1, y4 - 1, frameColor);
  if (!ModeOnly) {
     osd->DrawRectangle(x0, y5, x1 - 1, y6 - 1, frameColor);
     osd->DrawEllipse  (x1, y5, x2 - 1, y6 - 1, frameColor, -3);
     osd->DrawEllipse  (x0, y6, x1 - 1, y7 - 1, frameColor, 3);
     osd->DrawRectangle(x1, y6, x4 - 1, y7 - 1, frameColor);
     osd->DrawRectangle(x5, y6, x6 - 1, y7 - 1, frameColor);
     osd->DrawEllipse  (x6, y6, x7 - 1, y7 - 1, frameColor, 5);
     }
}
コード例 #16
0
void cSkinSTTNGDisplayReplay::SetCurrent(const char *Current)
{
  const cFont *font = cFont::GetFont(fontSml);
  int w = font->Width(Current);
  osd->DrawText(x3, y6, Current, Theme.Color(clrReplayCurrent), frameColor, font, lastCurrentWidth > w ? lastCurrentWidth : 0);
  lastCurrentWidth = w;
}
コード例 #17
0
ファイル: skinclassic.c プロジェクト: Moorviper/zen2vdr
cSkinClassicDisplayMenu::cSkinClassicDisplayMenu(void)
{
  const cFont *font = cFont::GetFont(fontOsd);
  lineHeight = font->Height();
  dateWidth = 0;
  x0 = 0;
  x1 = x0 + 2 * TextSpacing;
  x3 = cOsd::OsdWidth();
  x2 = x3 - 2 * ScrollWidth;
  y0 = 0;
  y1 = lineHeight;
  y2 = y1 + lineHeight;
  y5 = cOsd::OsdHeight();
  y4 = y5 - lineHeight;
  y3 = y4 - lineHeight;
  osd = cOsdProvider::NewOsd(cOsd::OsdLeft(), cOsd::OsdTop());
  tArea Areas[] = { { x0, y0, x3 - 1, y5 - 1, 8 } };
  if (Setup.AntiAlias && osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk)
     osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
  else {
     tArea Areas[] = { { x0, y0, x3 - 1, y5 - 1, 4 } };
     if (osd->CanHandleAreas(Areas, sizeof(Areas) / sizeof(tArea)) == oeOk)
        osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
     else {
        tArea Areas[] = { { x0, y0, x3 - 1, y1 - 1, 2 },
                          { x0, y1, x3 - 1, y3 - 1, 2 },
                          { x0, y3, x3 - 1, y5 - 1, 4 }
                        };
        osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
        }
     }
  osd->DrawRectangle(x0, y0, x3 - 1, y5 - 1, Theme.Color(clrBackground));
}
コード例 #18
0
void cSkinSTTNGDisplayMenu::SetScrollbar(void)
{
  if (textScroller.CanScroll()) {
     int h  = lineHeight;
     int yt = textScroller.Top();
     int yb = yt + textScroller.Height();
     int st = yt + h + Gap;
     int sb = yb - h - Gap;
     int tt = st + (sb - st) * textScroller.Offset() / textScroller.Total();
     int tb = tt + (sb - st) * textScroller.Shown() / textScroller.Total();
     osd->DrawRectangle(x5, st, x5 + ScrollWidth - 1, sb, Theme.Color(clrMenuScrollbarTotal));
     osd->DrawRectangle(x5, tt, x5 + ScrollWidth - 1, tb, Theme.Color(clrMenuScrollbarShown));
     osd->DrawRectangle(x5, yt, x6 - 1, yt + h - 1, frameColor);
     osd->DrawEllipse  (x6, yt, x7 - 1, yt + h - 1, frameColor, 5);
     osd->DrawRectangle(x5, yb - h, x6 - 1, yb - 1, frameColor);
     osd->DrawEllipse  (x6, yb - h, x7 - 1, yb - 1, frameColor, 5);
     if (textScroller.CanScrollUp()) {
        cBitmap bm(arrowup_xpm);
        osd->DrawBitmap(x5 + (x7 - x5 - bm.Width()) / 2 - 2, yt + (h - bm.Height()) / 2, bm, Theme.Color(clrMenuScrollbarArrow), frameColor);
        }
     if (textScroller.CanScrollDown()) {
        cBitmap bm(arrowdown_xpm);
        osd->DrawBitmap(x5 + (x7 - x5 - bm.Width()) / 2 - 2, yb - h + (h - bm.Height()) / 2, bm, Theme.Color(clrMenuScrollbarArrow), frameColor);
        }
     }
}
コード例 #19
0
ファイル: skinclassic.c プロジェクト: Moorviper/zen2vdr
void cSkinClassicDisplayTracks::SetItem(const char *Text, int Index, bool Current)
{
  int y = y1 + Index * lineHeight;
  tColor ColorFg, ColorBg;
  if (Current) {
     ColorFg = Theme.Color(clrMenuItemCurrentFg);
     ColorBg = Theme.Color(clrMenuItemCurrentBg);
     currentIndex = Index;
     }
  else {
     ColorFg = Theme.Color(clrMenuItemSelectable);
     ColorBg = Theme.Color(clrBackground);
     }
  const cFont *font = cFont::GetFont(fontOsd);
  osd->DrawText(x0, y, Text, ColorFg, ColorBg, font, x1 - x0);
}
コード例 #20
0
cSkinSTTNGDisplayVolume::cSkinSTTNGDisplayVolume(void)
{
  const cFont *font = cFont::GetFont(fontOsd);
  int lineHeight = font->Height();
  frameColor = Theme.Color(clrVolumeFrame);
  mute = -1;
  x0 = 0;
  x1 = lineHeight / 2;
  x2 = lineHeight;
  x3 = x2 + Gap;
  x7 = Setup.OSDWidth;
  x6 = x7 - lineHeight / 2;
  x5 = x6 - lineHeight / 2;
  x4 = x5 - Gap;
  y0 = 0;
  y1 = lineHeight;
  osd = cOsdProvider::NewOsd(Setup.OSDLeft, Setup.OSDTop + Setup.OSDHeight - y1);
  tArea Areas[] = { { x0, y0, x7 - 1, y1 - 1, 4 } };
  osd->SetAreas(Areas, sizeof(Areas) / sizeof(tArea));
  osd->DrawRectangle(x0, y0, x7 - 1, y1 - 1, clrTransparent);
  osd->DrawEllipse  (x0, y0, x1 - 1, y1 - 1, frameColor, 7);
  osd->DrawRectangle(x1, y0, x2 - 1, y1 - 1, frameColor);
  osd->DrawRectangle(x3, y0, x4 - 1, y1 - 1, frameColor);
  osd->DrawRectangle(x5, y0, x6 - 1, y1 - 1, frameColor);
  osd->DrawEllipse  (x6, y0, x7 - 1, y1 - 1, frameColor, 5);
}
コード例 #21
0
void cSkinSTTNGDisplayMenu::SetTitle(const char *Title)
{
  const cFont *font = cFont::GetFont(fontOsd);
  const char *VDR = " VDR";
  int w = font->Width(VDR);
  osd->DrawText(x3 + 5, y0, Title, Theme.Color(clrMenuTitle), frameColor, font, x4 - w - x3 - 5);
  osd->DrawText(x4 - w, y0, VDR, frameColor, clrBlack, font);
}
コード例 #22
0
void cSkinSTTNGDisplayChannel::SetMessage(eMessageType Type, const char *Text)
{
  const cFont *font = cFont::GetFont(withInfo ? fontSml : fontOsd);
  if (Text) {
     int yt = withInfo ? y6 : y0;
     int yb = withInfo ? y7 : y1;
     osd->SaveRegion(x2, yt, x4 - 1, yb - 1);
     if (withInfo)
        osd->DrawRectangle(x2, yt, x3 - 1, yb - 1, Theme.Color(clrBackground));
     osd->DrawText(x3, yt, Text, Theme.Color(clrMessageStatusFg + 2 * Type), Theme.Color(clrMessageStatusBg + 2 * Type), font, x4 - x3, 0, taCenter);
     message = true;
     }
  else {
     osd->RestoreRegion();
     message = false;
     }
}
コード例 #23
0
ファイル: skinclassic.c プロジェクト: Moorviper/zen2vdr
void cSkinClassicDisplayMenu::SetEvent(const cEvent *Event)
{
  if (!Event)
     return;
  const cFont *font = cFont::GetFont(fontOsd);
  int y = y2;
  cTextScroller ts;
  char t[32];
  snprintf(t, sizeof(t), "%s  %s - %s", *Event->GetDateString(), *Event->GetTimeString(), *Event->GetEndTimeString());
  ts.Set(osd, x1, y, x2 - x1, y3 - y, t, font, Theme.Color(clrMenuEventTime), Theme.Color(clrBackground));
  if (Event->Vps() && Event->Vps() != Event->StartTime()) {
     cString buffer = cString::sprintf(" VPS: %s ", *Event->GetVpsString());
     const cFont *font = cFont::GetFont(fontSml);
     int w = font->Width(buffer);
     osd->DrawText(x3 - w, y, buffer, Theme.Color(clrMenuEventVpsFg), Theme.Color(clrMenuEventVpsBg), font, w);
     }
  y += ts.Height();
  if (Event->ParentalRating()) {
     cString buffer = cString::sprintf(" %s ", *Event->GetParentalRatingString());
     const cFont *font = cFont::GetFont(fontSml);
     int w = font->Width(buffer);
     osd->DrawText(x3 - w, y, buffer, Theme.Color(clrMenuEventVpsFg), Theme.Color(clrMenuEventVpsBg), font, w);
     }
  y += font->Height();
  ts.Set(osd, x1, y, x2 - x1, y3 - y, Event->Title(), font, Theme.Color(clrMenuEventTitle), Theme.Color(clrBackground));
  y += ts.Height();
  if (!isempty(Event->ShortText())) {
     const cFont *font = cFont::GetFont(fontSml);
     ts.Set(osd, x1, y, x2 - x1, y3 - y, Event->ShortText(), font, Theme.Color(clrMenuEventShortText), Theme.Color(clrBackground));
     y += ts.Height();
     }
  for (int i = 0; Event->Contents(i); i++) {
      const char *s = Event->ContentToString(Event->Contents(i));
      if (!isempty(s)) {
         const cFont *font = cFont::GetFont(fontSml);
         ts.Set(osd, x1, y, x2 - x1, y3 - y, s, font, Theme.Color(clrMenuEventShortText), Theme.Color(clrBackground));
         y += ts.Height();
         }
      }
  y += font->Height();
  if (!isempty(Event->Description())) {
     textScroller.Set(osd, x1, y, x2 - x1, y3 - y, Event->Description(), font, Theme.Color(clrMenuEventDescription), Theme.Color(clrBackground));
     SetTextScrollbar();
     }
}
コード例 #24
0
void cSkinSTTNGDisplayMenu::Flush(void)
{
  if (!message) {
     cString date = DayDateTime();
     const cFont *font = cFont::GetFont(fontSml);
     osd->DrawText(x4 - font->Width(date) - 2, y7 - font->Height(date), date, Theme.Color(clrMenuDate), frameColor, font);
     }
  osd->Flush();
}
コード例 #25
0
void cSkinSTTNGDisplayChannel::SetEvents(const cEvent *Present, const cEvent *Following)
{
  if (!withInfo)
     return;
  if (present != Present)
     lastSeen = -1;
  present = Present;
  osd->DrawRectangle(x0, y3, x1 - 1, y4 - 1, frameColor);
  osd->DrawRectangle(x3, y3, x7 - 1, y4 - 1, Theme.Color(clrBackground));
  for (int i = 0; i < 2; i++) {
      const cEvent *e = !i ? Present : Following;
      if (e) {
         osd->DrawText(x0 + 2, y3 + 2 * i * lineHeight, e->GetTimeString(), Theme.Color(clrChannelEpgTime), frameColor, cFont::GetFont(fontOsd));
         osd->DrawText(x3 + 2, y3 + 2 * i * lineHeight, e->Title(), Theme.Color(clrChannelEpgTitle), Theme.Color(clrBackground), cFont::GetFont(fontOsd), x4 - x3 - 2);
         osd->DrawText(x3 + 2, y3 + (2 * i + 1) * lineHeight, e->ShortText(), Theme.Color(clrChannelEpgShortText), Theme.Color(clrBackground), cFont::GetFont(fontSml), x4 - x3 - 2);
         }
      }
}
コード例 #26
0
ファイル: cWindowManager.cpp プロジェクト: pilkch/library
    void cWindowManager::_RenderWindow(const cWindow& widget) const
    {
      const float title_bar_height = widget.GetTitleBarHeight();

      // Draw the top bar
      SetColourFromThemeColourAndAlpha(theme.GetColourWindowTitleBar());
      _RenderRectangle(widget.GetX(), widget.GetY(), widget.GetWidth(), title_bar_height);

      // Draw the rest of the window
      SetColourFromThemeColourAndAlpha(theme.GetColourWindowBackground());
      _RenderRectangle(widget.GetX(), widget.GetY() + title_bar_height, widget.GetWidth(), widget.GetHeight() - title_bar_height);

#if 0
      // Draw the caption if this window has one
      if (widget.HasCaption()) {
        /*glPushAttrib(GL_LIST_BIT | GL_CURRENT_BIT  | GL_ENABLE_BIT);
          {
            render::ApplyMaterial apply(pMaterial);

            pContext->SelectTextureUnit0();

            glMatrixMode(GL_TEXTURE);
            glPushMatrix();
              glLoadIdentity();

              glMatrixMode(GL_MODELVIEW);

              glColor4f(0.0f, 0.0f, 0.0f, 1.0f);*/

              //pFontWindowCaption->printfCenteredHorizontallyVertically(widget.GetX(), widget.GetY(),
              //  widget.GetWidth(), bar_height,
              //  breathe::string::ToUTF8(widget.GetCaption()).c_str());
              pFontWindowCaption->PrintCenteredHorizontally(widget.GetX(), widget.GetY(),
                widget.GetWidth(), widget.GetCaption());

              //glMatrixMode(GL_TEXTURE);
            //glPopMatrix();
          //}
        //glPopAttrib();
      }
#endif
    }
コード例 #27
0
void cSkinSTTNGDisplayChannel::SetChannel(const cChannel *Channel, int Number)
{
  osd->DrawRectangle(x3, y0, x4 - 1, y1 - 1, frameColor);
  int x = x4 - 5;
  if (Channel && !Channel->GroupSep()) {
     int d = 3;
     bool rec = cRecordControls::Active();
     x -= bmRecording.Width() + d;
     osd->DrawBitmap(x, y0 + (y1 - y0 - bmRecording.Height()) / 2, bmRecording, Theme.Color(rec ? clrChannelSymbolRecFg : clrChannelSymbolOff), rec ? Theme.Color(clrChannelSymbolRecBg) : frameColor);
     x -= bmEncrypted.Width() + d;
     osd->DrawBitmap(x, y0 + (y1 - y0 - bmEncrypted.Height()) / 2, bmEncrypted, Theme.Color(Channel->Ca() ? clrChannelSymbolOn : clrChannelSymbolOff), frameColor);
     x -= bmDolbyDigital.Width() + d;
     osd->DrawBitmap(x, y0 + (y1 - y0 - bmDolbyDigital.Height()) / 2, bmDolbyDigital, Theme.Color(Channel->Dpid(0) ? clrChannelSymbolOn : clrChannelSymbolOff), frameColor);
     x -= bmAudio.Width() + d;
     osd->DrawBitmap(x, y0 + (y1 - y0 - bmAudio.Height()) / 2, bmAudio, Theme.Color(Channel->Apid(1) ? clrChannelSymbolOn : clrChannelSymbolOff), frameColor);
     if (Channel->Vpid()) {
        x -= bmTeletext.Width() + d;
        osd->DrawBitmap(x, y0 + (y1 - y0 - bmTeletext.Height()) / 2, bmTeletext, Theme.Color(Channel->Tpid() ? clrChannelSymbolOn : clrChannelSymbolOff), frameColor);
        }
     else if (Channel->Apid(0)) {
        x -= bmRadio.Width() + d;
        osd->DrawBitmap(x, y0 + (y1 - y0 - bmRadio.Height()) / 2, bmRadio, Theme.Color(clrChannelSymbolOn), frameColor);
        }
     }
  osd->DrawText(x3 + 2, y0, ChannelString(Channel, Number), Theme.Color(clrChannelName), frameColor, cFont::GetFont(fontOsd), x - x3 - 2);
}
コード例 #28
0
ファイル: skinclassic.c プロジェクト: Moorviper/zen2vdr
void cSkinClassicDisplayMenu::SetButtons(const char *Red, const char *Green, const char *Yellow, const char *Blue)
{
  const cFont *font = cFont::GetFont(fontOsd);
  int w = x3 - x0;
  int t0 = x0;
  int t1 = x0 + w / 4;
  int t2 = x0 + w / 2;
  int t3 = x3 - w / 4;
  int t4 = x3;
  osd->DrawText(t0, y4, Red,    Theme.Color(clrButtonRedFg),    Red    ? Theme.Color(clrButtonRedBg)    : Theme.Color(clrBackground), font, t1 - t0, 0, taCenter);
  osd->DrawText(t1, y4, Green,  Theme.Color(clrButtonGreenFg),  Green  ? Theme.Color(clrButtonGreenBg)  : Theme.Color(clrBackground), font, t2 - t1, 0, taCenter);
  osd->DrawText(t2, y4, Yellow, Theme.Color(clrButtonYellowFg), Yellow ? Theme.Color(clrButtonYellowBg) : Theme.Color(clrBackground), font, t3 - t2, 0, taCenter);
  osd->DrawText(t3, y4, Blue,   Theme.Color(clrButtonBlueFg),   Blue   ? Theme.Color(clrButtonBlueBg)   : Theme.Color(clrBackground), font, t4 - t3, 0, taCenter);
}
コード例 #29
0
ファイル: skinclassic.c プロジェクト: Moorviper/zen2vdr
void cSkinClassicDisplayChannel::Flush(void)
{
  if (!message) {
     cString date = DayDateTime();
     if (!*lastDate || strcmp(date, lastDate)) {
        const cFont *font = cFont::GetFont(fontSml);
        int w = font->Width(date);
        osd->DrawText(osd->Width() - w - TextFrame, 0, date, Theme.Color(clrChannelDate), Theme.Color(clrBackground), cFont::GetFont(fontSml), w);
        lastDate = date;
        }
     }
  osd->Flush();
}
コード例 #30
0
void cSkinSTTNGDisplayTracks::SetAudioChannel(int AudioChannel)
{
  cBitmap *bm = NULL;
  switch (AudioChannel) {
    case 0: bm = &bmAudioStereo; break;
    case 1: bm = &bmAudioLeft;   break;
    case 2: bm = &bmAudioRight;  break;
    }
  if (bm)
     osd->DrawBitmap(x3 + 5, y6 + (y7 - y6 - bm->Height()) / 2, *bm, Theme.Color(clrChannelSymbolOn), frameColor);
  else
     osd->DrawRectangle(x3, y6, x4 - 1, y7 - 1, frameColor);
}