File: menuitems.h

package info (click to toggle)
vdr-plugin-xineliboutput 1.1.0%2Bcvs20150907-3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 2,480 kB
  • ctags: 4,398
  • sloc: ansic: 35,664; sh: 393; makefile: 286; cpp: 11
file content (133 lines) | stat: -rw-r--r-- 3,522 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
/*
 * menuitems.h: New menu item types
 *
 * See the main source file 'xineliboutput.c' for copyright information and
 * how to reach the author.
 *
 * $Id: menuitems.h,v 1.10 2010/01/19 22:06:52 phintuka Exp $
 *
 */

#ifndef __XINELIB_MENUITEMS_H_
#define __XINELIB_MENUITEMS_H_

#include <vdr/menuitems.h>

static inline cString Label_SubMenu(const char *Label)
{
  return cString::sprintf("%s >>", Label);
}

static inline cString Label_Ident(const char *Label)
{
  return cString::sprintf("  %s", Label);
}

static inline cString Label_Separator(const char *Label)
{
  return cString::sprintf("----- %s -----", Label);
}

static inline cOsdItem *SubMenuItem(const char *Label, eOSState state)
{
  return new cOsdItem(Label_SubMenu(Label), state);
}

static inline cOsdItem *SeparatorItem(const char *Label)
{
  cOsdItem *Item = new cOsdItem(Label_Separator(Label));
  Item->SetSelectable(false);
  return Item;
}

// --- cMenuEditTypedIntItem -------------------------------------------------

class cMenuEditTypedIntItem : public cMenuEditIntItem 
{
  protected:
    cString type;
    cString zeroString;

    virtual void Set(void);

  public:
    cMenuEditTypedIntItem(const char *Name, const char *Type, int *Value, 
			  int Min = 0, int Max = INT_MAX, const char *ZeroString = NULL,
			  const char *MinString = NULL, const char *MaxString = NULL);
};

// --- cMenuEditOddIntItem -------------------------------------------------

class cMenuEditOddIntItem : public cMenuEditIntItem
{
  public:
    cMenuEditOddIntItem(const char *Name, int *Value, int Min = 1, int Max = INT_MAX, const char *MinString = NULL, const char *MaxString = NULL);
    eOSState ProcessKey(eKeys Key);
};


// --- cMenuEditFpIntItem -------------------------------------------------

// Fixed-point decimal number

class cMenuEditFpIntItem : public cMenuEditIntItem
{
  protected:
    int decimals;
    cString zeroString;

    virtual void Set(void);

  public:
    cMenuEditFpIntItem(const char *Name, int *Value, int Min = 1, int Max = INT_MAX,
                       int Decimals = 1, const char *ZeroString = NULL,
                       const char *MinString = NULL, const char *MaxString = NULL);
};


// --- cMenuEditStraI18nItem -------------------------------------------------

class cMenuEditStraI18nItem : public cMenuEditIntItem 
{
  private:
    const char * const *strings;

  protected:
    virtual void Set(void);

  public:
    cMenuEditStraI18nItem(const char *Name, int *Value, 
			  int NumStrings, const char * const *Strings);
};

// --- cFileListItem ---------------------------------------------------------

class cFileListItem : public cOsdItem 
{
  private:
    cString m_Name;
    cString m_SubFile;
    bool  m_IsDir, m_HasResume, m_ShowFlags, m_Up;
    bool  m_IsDvd, m_IsBluRay;

  protected:
    virtual void Set(void);

  public:
    cFileListItem(const char *name, bool isDir,
                  bool HasResume, const char *subfile,
                  bool IsDvd = false, bool IsBluRay = false);
    cFileListItem(const char *name, bool isDir);

    const char *Name(void)    { return m_Name; }
    const char *SubFile(void) { return m_SubFile; }
    bool IsDir(void)       { return m_IsDir; }
    bool IsDvd(void)       { return m_IsDvd; }
    bool IsBluRay(void)    { return m_IsBluRay; }
    bool HasResume(void)   { return m_HasResume; }

    virtual bool operator< (const cListObject &ListObject);
    virtual int Compare(const cListObject &ListObject) const;
};

#endif //__XINELIB_MENUITEMS_H_