Go to the documentation of this file.
11 #include <vdr/plugin.h>
12 #include <vdr/skins.h>
13 #include <vdr/videodir.h>
14 #include <vdr/tools.h>
24 virtual int Width(
void)
const {
return 1; }
25 virtual int Width(uint c)
const {
return 1; }
27 virtual int Height(
void)
const {
return 1; }
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
71 virtual void SaveRegion(
int x1,
int y1,
int x2,
int y2);
75 virtual void Flush(
void);
85 leaveok(stdscr,
true);
103 int color = (colorBg << 16) | colorFg | 0x80000000;
107 init_pair(i + 1, colorFg, colorBg);
109 wattrset(
window, COLOR_PAIR(i + 1));
113 wattrset(
window, COLOR_PAIR(i + 1));
125 savedRegion = newwin(y2 - y1 + 1, x2 - x1 + 1, y1, x1);
151 if ((Alignment &
taLeft) != 0)
153 else if ((Alignment &
taRight) != 0) {
159 x += (
Width - w) / 2;
163 if ((Alignment &
taTop) != 0)
165 else if ((Alignment &
taBottom) != 0) {
183 for (
int y = y1; y <= y2; y++) {
185 whline(
window,
' ', x2 - x1 + 1);
208 virtual void Flush(
void);
213 int Lines = WithInfo ? 5 : 1;
235 for (
int i = 0; i < 2; i++) {
236 const cEvent *e = !i ? Present : Following;
275 void DrawScrollbar(
int Total,
int Offset,
int Shown,
int Top,
int Height,
bool CanScrollUp,
bool CanScrollDown);
280 virtual void Scroll(
bool Up,
bool Page);
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);
286 virtual void SetItem(
const char *Text,
int Index,
bool Current,
bool Selectable);
290 virtual void SetText(
const char *Text,
bool FixedFont);
292 virtual void Flush(
void);
309 if (Total > 0 && Total > Shown) {
311 int yb = yt + Height;
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);
384 int ColorFg, ColorBg;
393 for (
int i = 0; i <
MaxTabs; i++) {
434 for (
int i = 0; Event->
Contents(i); i++) {
463 const char *Title = Info->
Title();
465 Title = Recording->
Name();
472 for (
int i = 0; Info->
GetEvent()->Contents(i); i++) {
510 virtual void SetTitle(
const char *Title);
511 virtual void SetMode(
bool Play,
bool Forward,
int Speed);
514 virtual void SetTotal(
const char *Total);
515 virtual void SetJump(
const char *Jump);
517 virtual void Flush(
void);
541 if (Speed == -1) Mode = Play ?
" > " :
" || ";
542 else if (Play) Mode = Forward ?
" X>> " :
" <<X ";
543 else Mode = Forward ?
" X|> " :
" <|X ";
546 char *p = strchr(buf,
'X');
548 *p = Speed > 0 ?
'1' + Speed - 1 :
' ';
602 virtual void Flush(
void);
623 const char *Prompt =
tr(
"Volume ");
648 virtual void SetTrack(
int Index,
const char *
const *Tracks);
650 virtual void Flush(
void);
657 for (
int i = 0; i < NumTracks; i++)
663 for (
int i = 0; i < NumTracks; i++)
675 int ColorFg, ColorBg;
692 SetItem(Tracks[Index], Index,
true);
709 virtual void Flush(
void);
753 return tr(
"Text mode");
799 virtual bool Start(
void);
835 WINDOW *w = initscr();
838 getmaxyx(w, maxy,maxx);
839 getbegyx(w, begy,begx);
845 esyslog(
"skincurses: unable to initialize curses screen");
virtual cSkinDisplayTracks * DisplayTracks(const char *Title, int NumTracks, const char *const *Tracks)
Creates and returns a new object for displaying the available tracks.
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.
static cString sprintf(const char *fmt,...) __attribute__((format(printf
int ParentalRating(void) const
cString ChannelString(const cChannel *Channel, int Number)
cSkinCursesDisplayTracks(const char *Title, int NumTracks, const char *const *Tracks)
cCursesOsd(int Left, int Top)
virtual bool SetupParse(const char *Name, const char *Value)
const char * Title(void) const
static const char * DESCRIPTION
const cRecordingInfo * Info(void) const
virtual void SetCurrent(const char *Current)
Sets the current position within the recording, as a user readable string if the form "h:mm:ss....
The cOsd class is the interface to the "On Screen Display".
virtual void Flush(void)
Actually draws the OSD display to the output device.
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...
uchar Contents(int i=0) const
virtual bool ProcessArgs(int argc, char *argv[])
const char * Description(void) const
virtual const char * MainMenuEntry(void)
virtual const char * Version(void)
virtual ~cPluginSkinCurses()
const char * Title(void) const
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...
virtual cSkinDisplayChannel * DisplayChannel(bool WithInfo)
Creates and returns a new object for displaying the current channel.
cSkinCursesDisplayChannel(bool WithInfo)
virtual int Width(const char *s) const
Returns the width of the given string in pixel.
virtual void SaveRegion(int x1, int y1, int x2, int y2)
Saves the region defined by the given coordinates for later restoration through RestoreRegion().
virtual void SetAudioChannel(int AudioChannel)
Sets the audio channel indicator.
const char * ShortText(void) const
virtual void RestoreRegion(void)
Restores the region previously saved by a call to SaveRegion().
virtual cOsdObject * MainMenuAction(void)
virtual int Width(void) const
Returns the original character width as requested when the font was created, or 0 if the default widt...
virtual ~cSkinCursesDisplayMessage()
const char * Name(void) const
Returns the full name of the recording (without the video directory).
virtual void SetVolume(int Current, int Total, bool Mute)
< This class implements the volume/mute display.
virtual void SetMessage(eMessageType Type, const char *Text)
Sets a one line message Text, with the given Type.
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...
virtual cSkinDisplayMenu * DisplayMenu(void)
Creates and returns a new object for displaying a menu.
virtual const char * Description(void)
Returns a user visible, single line description of this skin, which may consist of arbitrary text and...
virtual void RestoreRegion(void)
Restores the region previously saved by a call to SaveRegion().
virtual const char * CommandLineHelp(void)
virtual void DrawText(cPixmap *Pixmap, int x, int y, const char *s, tColor ColorFg, tColor ColorBg, int Width) const
static cString String(void)
Returns a localized string of the form "Disk nn% - hh:mm free".
virtual cMenuSetupPage * SetupMenu(void)
void SetEditableWidth(int Width)
If an item is set through a call to cSkinDisplayMenu::SetItem(), this function shall be called to set...
void Set(cOsd *Osd, int Left, int Top, int Width, int Height, const char *Text, const cFont *Font, tColor ColorFg, tColor ColorBg)
static cSkinDisplay * Current(void)
Returns the currently active cSkinDisplay.
virtual const char * Description(void)
cSkinCursesDisplayReplay(bool ModeOnly)
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.
virtual void SetTotal(const char *Total)
Sets the total length of the recording, as a user readable string if the form "h:mm:ss".
VDRPLUGINCREATOR(cPluginSkinCurses)
time_t StartTime(void) const
virtual void Flush(void)
Actually commits all data to the OSD hardware.
cString GetParentalRatingString(void) const
virtual bool Initialize(void)
static const char * ContentToString(uchar Content)
virtual void SetChannel(const cChannel *Channel, int Number)
Sets the current channel to Channel.
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...
virtual void SetJump(const char *Jump)
Sets the prompt that allows the user to enter a jump point.
static const char * MAINMENUENTRY
void SetColor(int colorFg, int colorBg=clrBackground)
cString GetTimeString(void) const
virtual void Housekeeping(void)
virtual void SaveRegion(int x1, int y1, int x2, int y2)
Saves the region defined by the given coordinates for later restoration through RestoreRegion().
cSkinCursesDisplayVolume(void)
virtual void SetTrack(int Index, const char *const *Tracks)
< This class implements the track display.
virtual int Width(uint c) const
Returns the width of the given character in pixel.
cString GetVpsString(void) const
int colorPairs[MaxColorPairs]
const char * ChannelName(void) const
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...
virtual void Flush(void)
Actually draws the OSD display to the output device.
static const char * VERSION
const cEvent * GetEvent(void) const
virtual ~cSkinCursesDisplayVolume()
const char * Description(void) const
void SetItem(const char *Text, int Index, bool Current)
cString GetDateString(void) const
virtual ~cSkinCursesDisplayReplay()
virtual void SetMessage(eMessageType Type, const char *Text)
< This class implements a simple message display.
cString GetEndTimeString(void) const
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.
virtual void SetEvents(const cEvent *Present, const cEvent *Following)
Sets the Present and Following EPG events.
virtual void SetMessage(eMessageType Type, const char *Text)
Sets a one line message Text, with the given Type.
virtual ~cSkinCursesDisplayTracks()
static int AvgCharWidth(void)
Returns the average width of a character in pixel (just a raw estimate).
virtual cSkinDisplayVolume * DisplayVolume(void)
Creates and returns a new object for displaying the current volume.
virtual void Flush(void)
Actually draws the OSD display to the output device.
cSkinCursesDisplayMessage(void)
virtual int Height(void) const
Returns the height of this font in pixel (all characters have the same height).
virtual void Flush(void)
Actually commits all data to the OSD hardware.
virtual cSkinDisplayMessage * DisplayMessage(void)
Creates and returns a new object for displaying a message.
virtual cSkinDisplayReplay * DisplayReplay(bool ModeOnly)
Creates and returns a new object for displaying replay progress.
virtual void Flush(void)
Actually draws the OSD display to the output device.
static const cCursesFont Font
virtual void Flush(void)
Actually draws the OSD display to the output device.
const char * ShortText(void) const
virtual void SetTitle(const char *Title)
Sets the title of the recording.
bool SetCurrent(const char *Name=NULL)
Sets the current skin to the one indicated by name.
virtual ~cSkinCursesDisplayChannel()