11#include <vdr/plugin.h>
13#include <vdr/videodir.h>
23 virtual int Width(
void)
const override {
return 1; }
24 virtual int Width(uint c)
const override {
return 1; }
26 virtual int Height(
void)
const override {
return 1; }
35#define clrBackground COLOR_BLACK
36#define clrTransparent clrBackground
37#define clrBlack clrBackground
38#define clrRed COLOR_RED
39#define clrGreen COLOR_GREEN
40#define clrYellow COLOR_YELLOW
41#define clrBlue COLOR_BLUE
42#define clrMagenta COLOR_MAGENTA
43#define clrCyan COLOR_CYAN
44#define clrWhite COLOR_WHITE
68 virtual void SaveRegion(
int x1,
int y1,
int x2,
int y2)
override;
72 virtual void Flush(
void)
override;
81 leaveok(stdscr,
true);
86 getmaxyx(stdscr, maxy, maxx);
87 getbegyx(stdscr, begy, begx);
100 int color = (colorBg << 16) | colorFg | 0x80000000;
105 init_pair(i + 1, colorFg, colorBg);
107 attrset(COLOR_PAIR(i + 1));
116 savedRegion = newwin(y2 - y1 + 1, x2 - x1 + 1, y1, x1);
118 copywin(stdscr,
savedRegion, y1, x1, 0, 0, y2 - y1, x2 - x1,
false);
132 int w =
Font->Width(s);
133 int h =
Font->Height();
139 if ((Alignment &
taLeft) != 0)
141 else if ((Alignment &
taRight) != 0) {
147 x += (
Width - w) / 2;
151 if ((Alignment &
taTop) != 0)
153 else if ((Alignment &
taBottom) != 0) {
173 for (
int y = y1; y <= y2; y++)
174 mvhline(y, x1,
' ', dx + 1);
177 for (
int x = x1; x <= x2; x++)
178 mvvline(y1, x,
' ', dy + 1);
200 virtual void Flush(
void)
override;
205 int Lines = WithInfo ? 5 : 1;
227 for (
int i = 0; i < 2; i++) {
228 const cEvent *e = !i ? Present : Following;
245 osd->RestoreRegion();
267 void DrawScrollbar(
int Total,
int Offset,
int Shown,
int Top,
int Height,
bool CanScrollUp,
bool CanScrollDown);
272 virtual void Scroll(
bool Up,
bool Page)
override;
273 virtual int MaxItems(
void)
override;
274 virtual void Clear(
void)
override;
275 virtual void SetTitle(
const char *Title)
override;
276 virtual void SetButtons(
const char *Red,
const char *Green = NULL,
const char *Yellow = NULL,
const char *Blue = NULL)
override;
278 virtual void SetItem(
const char *Text,
int Index,
bool Current,
bool Selectable)
override;
279 virtual void SetScrollbar(
int Total,
int Offset)
override;
282 virtual void SetText(
const char *Text,
bool FixedFont)
override;
284 virtual void Flush(
void)
override;
301 if (Total > 0 && Total > Shown) {
303 int yb = yt + Height;
306 int th =
max(
int((sb - st) *
double(Shown) / Total + 0.5), 1);
307 int tt =
min(
int(st + (sb - st) *
double(Offset) / Total + 0.5), sb - th);
308 int tb =
min(tt + th, sb);
311 osd->DrawRectangle(xl, tt, xl, tb - 1,
clrCyan);
376 int ColorFg, ColorBg;
385 for (
int i = 0; i <
MaxTabs; i++) {
426 for (
int i = 0; Event->
Contents(i); i++) {
464 const char *Title = Info->
Title();
466 Title = Recording->
Name();
473 for (
int i = 0; Info->
GetEvent()->Contents(i); i++) {
511 virtual void SetTitle(
const char *Title)
override;
512 virtual void SetMode(
bool Play,
bool Forward,
int Speed)
override;
515 virtual void SetTotal(
const char *Total)
override;
516 virtual void SetJump(
const char *Jump)
override;
518 virtual void Flush(
void)
override;
540 if (
Setup.ShowReplayMode) {
542 if (Speed == -1) Mode = Play ?
" > " :
" || ";
543 else if (Play) Mode = Forward ?
" X>> " :
" <<X ";
544 else Mode = Forward ?
" X|> " :
" <|X ";
547 char *p = strchr(buf,
'X');
549 *p = Speed > 0 ?
'1' + Speed - 1 :
' ';
584 osd->RestoreRegion();
603 virtual void Flush(
void)
override;
624 const char *Prompt =
tr(
"Volume ");
649 virtual void SetTrack(
int Index,
const char *
const *Tracks)
override;
651 virtual void Flush(
void)
override;
658 for (
int i = 0; i < NumTracks; i++)
664 for (
int i = 0; i < NumTracks; i++)
676 int ColorFg, ColorBg;
693 SetItem(Tracks[Index], Index,
true);
710 virtual void Flush(
void)
override;
754 return tr(
"Text mode");
798 virtual bool ProcessArgs(
int argc,
char *argv[])
override;
800 virtual bool Start(
void)
override;
805 virtual bool SetupParse(
const char *
Name,
const char *Value)
override;
cString ChannelString(const cChannel *Channel, int Number)
virtual int Width(void) const override
Returns the original character width as requested when the font was created, or 0 if the default widt...
virtual int Width(const char *s) const override
Returns the width of the given string in pixel.
virtual int Height(void) const override
Returns the height of this font in pixel (all characters have the same height).
virtual int Width(uint c) const override
Returns the width of the given character in pixel.
virtual void DrawText(cBitmap *Bitmap, int x, int y, const char *s, tColor ColorFg, tColor ColorBg, int Width) const override
Draws the given text into the Bitmap at position (x, y) with the given colors.
virtual void DrawText(cPixmap *Pixmap, int x, int y, const char *s, tColor ColorFg, tColor ColorBg, int Width) const override
cVector< int > colorPairs
virtual void DrawRectangle(int x1, int y1, int x2, int y2, tColor Color) override
Draws a filled rectangle defined by the upper left (x1, y1) and lower right (x2, y2) corners with the...
virtual void SaveRegion(int x1, int y1, int x2, int y2) override
Saves the region defined by the given coordinates for later restoration through RestoreRegion().
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) override
Draws the given string at coordinates (x, y) with the given foreground and background color and font.
virtual ~cCursesOsd() override
cCursesOsd(int Left, int Top)
void SetColor(int colorFg, int colorBg=clrBackground)
virtual void Flush(void) override
Actually commits all data to the OSD hardware.
virtual void RestoreRegion(void) override
Restores the region previously saved by a call to SaveRegion().
const char * ShortText(void) const
static const char * ContentToString(uchar Content)
cString GetDateString(void) const
uchar Contents(int i=0) const
const char * Description(void) const
int ParentalRating(void) const
time_t StartTime(void) const
cString GetTimeString(void) const
const char * Title(void) const
cString GetEndTimeString(void) const
cString GetVpsString(void) const
cString GetParentalRatingString(void) const
The cOsd class is the interface to the "On Screen Display".
cOsd(int Left, int Top, uint Level)
Initializes the OSD with the given coordinates.
virtual ~cPluginSkinCurses() override
virtual cMenuSetupPage * SetupMenu(void) override
virtual void Housekeeping(void) override
virtual bool SetupParse(const char *Name, const char *Value) override
virtual const char * Version(void) override
virtual bool Start(void) override
virtual bool Initialize(void) override
virtual cOsdObject * MainMenuAction(void) override
virtual const char * Description(void) override
virtual const char * MainMenuEntry(void) override
virtual const char * CommandLineHelp(void) override
virtual bool ProcessArgs(int argc, char *argv[]) override
const char * ChannelName(void) const
const cEvent * GetEvent(void) const
const char * ShortText(void) const
const char * Title(void) const
const char * Description(void) const
const char * Name(void) const
Returns the full name of the recording (without the video directory).
cRecordingInfo * Info(void) const
virtual void SetChannel(const cChannel *Channel, int Number) override
Sets the current channel to Channel.
virtual void SetEvents(const cEvent *Present, const cEvent *Following) override
Sets the Present and Following EPG events.
virtual void Flush(void) override
Actually draws the OSD display to the output device.
cSkinCursesDisplayChannel(bool WithInfo)
virtual void SetMessage(eMessageType Type, const char *Text) override
Sets a one line message Text, with the given Type.
virtual ~cSkinCursesDisplayChannel() override
cSkinCursesDisplayMessage(void)
virtual void Flush(void) override
Actually draws the OSD display to the output device.
virtual ~cSkinCursesDisplayMessage() override
virtual void SetMessage(eMessageType Type, const char *Text) override
< This class implements a simple message display.
cSkinCursesDisplayReplay(bool ModeOnly)
virtual void SetJump(const char *Jump) override
Sets the prompt that allows the user to enter a jump point.
virtual void SetTotal(const char *Total) override
Sets the total length of the recording, as a user readable string in the form "h:mm:ss".
virtual void Flush(void) override
Actually draws the OSD display to the output device.
virtual void SetMode(bool Play, bool Forward, int Speed) override
Sets the current replay mode, which can be used to display some indicator, showing the user whether w...
virtual void SetMessage(eMessageType Type, const char *Text) override
Sets a one line message Text, with the given Type.
virtual void SetTitle(const char *Title) override
Sets the title of the recording.
virtual void SetProgress(int Current, int Total) override
This function will be called whenever the position in or the total length of the recording has change...
virtual ~cSkinCursesDisplayReplay() override
virtual void SetCurrent(const char *Current) override
Sets the current position within the recording, as a user readable string in the form "h:mm:ss....
cSkinCursesDisplayTracks(const char *Title, int NumTracks, const char *const *Tracks)
virtual ~cSkinCursesDisplayTracks() override
void SetItem(const char *Text, int Index, bool Current)
virtual void SetAudioChannel(int AudioChannel) override
Sets the audio channel indicator.
virtual void Flush(void) override
Actually draws the OSD display to the output device.
virtual void SetTrack(int Index, const char *const *Tracks) override
< This class implements the track display.
virtual void SetVolume(int Current, int Total, bool Mute) override
< This class implements the volume/mute display.
virtual void Flush(void) override
Actually draws the OSD display to the output device.
virtual ~cSkinCursesDisplayVolume() override
cSkinCursesDisplayVolume(void)
virtual const char * Description(void) override
Returns a user visible, single line description of this skin, which may consist of arbitrary text and...
virtual cSkinDisplayMenu * DisplayMenu(void) override
Creates and returns a new object for displaying a menu.
virtual cSkinDisplayTracks * DisplayTracks(const char *Title, int NumTracks, const char *const *Tracks) override
Creates and returns a new object for displaying the available tracks.
virtual cSkinDisplayMessage * DisplayMessage(void) override
Creates and returns a new object for displaying a message.
virtual cSkinDisplayReplay * DisplayReplay(bool ModeOnly) override
Creates and returns a new object for displaying replay progress.
virtual cSkinDisplayVolume * DisplayVolume(void) override
Creates and returns a new object for displaying the current volume.
virtual cSkinDisplayChannel * DisplayChannel(bool WithInfo) override
Creates and returns a new object for displaying the current channel.
cSkinDisplayChannel(void)
static cSkinDisplay * Current(void)
Returns the currently active cSkinDisplay.
void SetEditableWidth(int Width)
If an item is set through a call to cSkinDisplayMenu::SetItem(), this function shall be called to set...
static int AvgCharWidth(void)
Returns the average width of a character in pixel (just a raw estimate).
cSkin(const char *Name, cTheme *Theme=NULL)
Creates a new skin class, with the given Name and Theme.
static cString sprintf(const char *fmt,...) __attribute__((format(printf
void Set(cOsd *Osd, int Left, int Top, int Width, int Height, const char *Text, const cFont *Font, tColor ColorFg, tColor ColorBg)
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...
static cString String(void)
Returns a localized string of the form "Disk nn% - hh:mm free".
static const char * VERSION
static const char * DESCRIPTION
static const char * MAINMENUENTRY
#define VDRPLUGINCREATOR(PluginClass)
static const char * VERSION
static const char * DESCRIPTION
static const cCursesFont Font
static const char * MAINMENUENTRY