task-vuplus-enigma2
[vuplus_openvuplus_3.0] / meta-openvuplus / recipes-enigma2 / enigma2 / enigma2 / enigma2_vuplus_vfd.patch
1 diff --git a/configure.ac b/configure.ac
2 index 4902a9c..4bd2117 100644
3 --- a/configure.ac
4 +++ b/configure.ac
5 @@ -207,4 +207,5 @@ tools/enigma2.sh
6  enigma2.pc
7  ])
8  AC_DEFINE(BUILD_VUPLUS,1,[Define to 1 for vuplus])
9 +AC_DEFINE(BUILD_VUPLUS_DUO,1,[Define to 1 for duo])
10  AC_OUTPUT
11 diff --git a/lib/gdi/glcddc.cpp b/lib/gdi/glcddc.cpp
12 index 096705e..bcf0f5f 100755
13 --- a/lib/gdi/glcddc.cpp
14 +++ b/lib/gdi/glcddc.cpp
15 @@ -34,6 +34,16 @@ void gLCDDC::exec(gOpcode *o)
16  {
17         switch (o->opcode)
18         {
19 +#ifdef BUILD_VUPLUS_DUO /* ikseong  */
20 +       case gOpcode::renderText:
21 +               if (o->parm.renderText->text)
22 +               {
23 +                       lcd->updates(gDC::m_current_offset,o->parm.renderText->text);
24 +                       free(o->parm.renderText->text);
25 +                       delete o->parm.renderText;
26 +               }
27 +               break;
28 +#endif                 
29         case gOpcode::flush:
30  //             if (update)
31  #ifndef BUILD_VUPLUS /* ikseong  */
32 diff --git a/lib/gdi/lcd.cpp b/lib/gdi/lcd.cpp
33 index 9cb657c..83add38 100755
34 --- a/lib/gdi/lcd.cpp
35 +++ b/lib/gdi/lcd.cpp
36 @@ -228,3 +228,25 @@ void eDBoxLCD::update()
37         }
38  }
39  
40 +#ifdef BUILD_VUPLUS_DUO /* ikseong  */
41 +char *eDBoxLCD::remaketext(char *text)
42 +{
43 +       int len = strlen(text);
44 +       int i;
45 +       for(i=0;i<len;i++)
46 +       {
47 +               if(text[i]==0x0a)
48 +                       text[i] = 0x20;
49 +       }
50 +       return text;
51 +}
52 +
53 +void eDBoxLCD::updates(ePoint start,char *text)
54 +{
55 +       if((lcdfd >= 0) && (start.y() < 5))
56 +       {
57 +               text = remaketext(text);
58 +               write(lcdfd,text,strlen(text));
59 +       }
60 +}
61 +#endif
62 diff --git a/lib/gdi/lcd.h b/lib/gdi/lcd.h
63 index e7b4c2c..561e3b0 100644
64 --- a/lib/gdi/lcd.h
65 +++ b/lib/gdi/lcd.h
66 @@ -36,6 +36,9 @@ public:
67         int stride() { return _stride; }
68         eSize size() { return res; }
69         virtual void update()=0;
70 +#ifdef BUILD_VUPLUS_DUO /* ikseong  */
71 +       virtual void updates(ePoint start,char *text) = 0;
72 +#endif
73  #endif
74  };
75  
76 @@ -59,6 +62,10 @@ public:
77         void setInverted( unsigned char );
78         bool isOled() const { return !!is_oled; }
79         void update();
80 +#ifdef BUILD_VUPLUS_DUO /* ikseong  */
81 +       char *remaketext(char *text);
82 +       void updates(ePoint start,char *text);
83 +#endif
84  };
85  
86  #endif
87 diff --git a/lib/python/Screens/ChoiceBox.py b/lib/python/Screens/ChoiceBox.py
88 index 7c8b142..39e70d4 100644
89 --- a/lib/python/Screens/ChoiceBox.py
90 +++ b/lib/python/Screens/ChoiceBox.py
91 @@ -31,7 +31,9 @@ class ChoiceBox(Screen):
92                         pos += 1
93                 self["list"] = ChoiceList(list = self.list, selection = selection)
94                 self["summary_list"] = StaticText()
95 -               self.updateSummary()
96 +#      ikseong
97 +#              self.updateSummary()
98 +               self.updateSummary(selection)
99                                 
100                 self["actions"] = NumberActionMap(["WizardActions", "InputActions", "ColorActions", "DirectionActions"], 
101                 {
102 @@ -120,14 +122,21 @@ class ChoiceBox(Screen):
103         def updateSummary(self, curpos=0):
104                 pos = 0
105                 summarytext = ""
106 +#      ikseong         
107 +#              for entry in self.summarylist:
108 +#                      if pos > curpos-2 and pos < curpos+5:
109 +#                              if pos == curpos:
110 +#                                      summarytext += ">"
111 +#                              else:
112 +#                                      summarytext += entry[0]
113 +#                              summarytext += ' ' + entry[1] + '\n'
114 +#                      pos += 1
115                 for entry in self.summarylist:
116 -                       if pos > curpos-2 and pos < curpos+5:
117 -                               if pos == curpos:
118 -                                       summarytext += ">"
119 -                               else:
120 -                                       summarytext += entry[0]
121 -                               summarytext += ' ' + entry[1] + '\n'
122 +                       if pos == curpos:
123 +                               summarytext += entry[1] +'\n'
124 +                               break
125                         pos += 1
126 +#
127                 self["summary_list"].setText(summarytext)
128  
129         def cancel(self):
130 diff --git a/lib/python/enigma_python.i b/lib/python/enigma_python.i
131 index 0bddce1..040952d 100755
132 --- a/lib/python/enigma_python.i
133 +++ b/lib/python/enigma_python.i
134 @@ -131,6 +131,7 @@ is usually caused by not marking PSignals as immutable.
135  
136  #define DEBUG
137  #define BUILD_VUPLUS
138 +#define BUILD_VUPLUS_DUO
139  typedef long time_t;
140  %include "typemaps.i"
141  %include "std_string.i"