[filestreamproxy] some bugs fixed.
[vuplus_openvuplus] / meta-openvuplus / recipes-vuplus / enigma2 / enigma2 / enigma2_vuplus_vfd_mode.patch
1 diff --git a/configure.ac b/configure.ac
2 index 27beb1e..8e007e1 100644
3 --- a/configure.ac
4 +++ b/configure.ac
5 @@ -46,6 +46,28 @@ AC_CHECK_LIB([xmlccwrap], [exit], [LIBXMLCCWRAP_LIBS="-lxmlccwrap"], [AC_MSG_ERR
6  AC_SUBST(LIBXMLCCWRAP_LIBS)
7  AC_LANG_POP
8  
9 +
10 +AC_ARG_WITH(display-text-vfd,
11 +        AC_HELP_STRING([--with-display-text-vfd], [use text based vfd, yes or no]),
12 +        [[withtextvfd=$withval]],
13 +        [[withtextvfd=no]]
14 +)
15 +if test x"$withtextvfd" != xno ; then
16 +        AC_DEFINE(DISPLAY_TEXTVFD, 1,[Define when using an text based vfd device])
17 +fi
18 +AM_CONDITIONAL(DISPLAY_TEXTVFD, test x"$withtextvfd" != xno)
19 +
20 +AC_ARG_WITH(display-graphic-vfd,
21 +        AC_HELP_STRING([--with-display-graphic-vfd], [use graphic based vfd, yes or no]),
22 +        [[withgraphicvfd=$withval]],
23 +        [[withgraphicvfd=no]]
24 +)
25 +if test x"$withgraphicvfd" != xno ; then
26 +        AC_DEFINE(DISPLAY_GRAPHICVFD, 1,[Define when using an graphic based vfd device])
27 +fi
28 +AM_CONDITIONAL(DISPLAY_GRAPHICVFD, test x"$withgraphicvfd != xno")
29 +
30 +
31  AC_ARG_WITH(libsdl,
32         AS_HELP_STRING([--with-libsdl],[use libsdl, yes or no]),
33         [with_libsdl=$withval],[with_libsdl=no])
34 diff --git a/lib/gdi/glcddc.cpp b/lib/gdi/glcddc.cpp
35 index 8ac8cd3..74f6afd 100755
36 --- a/lib/gdi/glcddc.cpp
37 +++ b/lib/gdi/glcddc.cpp
38 @@ -34,13 +34,23 @@ void gLCDDC::exec(const gOpcode *o)
39  {
40         switch (o->opcode)
41         {
42 +#if defined(DISPLAY_TEXTVFD)
43 +       case gOpcode::renderText:
44 +               if (o->parm.renderText->text)
45 +               {
46 +                       lcd->updates(gDC::m_current_offset, o->parm.renderText->text);
47 +                       free(o->parm.renderText->text);
48 +                       delete o->parm.renderText;
49 +               }
50 +               break;
51 +#endif /*defined(DISPLAY_TEXTVFD)*/
52         case gOpcode::flush:
53 +#if defined(DISPLAY_GRAPHICVFD) && !defined(DISPLAY_TEXTVFD)
54  //             if (update)
55 -#ifndef BUILD_VUPLUS /* ikseong  */
56                         lcd->update();
57  #else
58 -                       ;
59 -#endif
60 +               ;
61 +#endif /*defined(DISPLAY_GRAPHICVFD) && !defined(DISPLAY_TEXTVFD)*/
62         default:
63                 gDC::exec(o);
64                 break;
65 diff --git a/lib/gdi/lcd.cpp b/lib/gdi/lcd.cpp
66 index a5ac351..74bc3e0 100755
67 --- a/lib/gdi/lcd.cpp
68 +++ b/lib/gdi/lcd.cpp
69 @@ -183,9 +183,7 @@ eDBoxLCD *eDBoxLCD::getInstance()
70  
71  void eDBoxLCD::update()
72  {
73 -#ifdef BUILD_VUPLUS /* ikseong  */
74 -       return ;
75 -#endif
76 +#if defined(DISPLAY_GRAPHICVFD) && !defined(DISPLAY_TEXTVFD)
77         if (lcdfd >= 0)
78         {
79                 if (!is_oled || is_oled == 2)
80 @@ -227,5 +225,20 @@ void eDBoxLCD::update()
81                         write(lcdfd, raw, 64*64);
82                 }
83         }
84 +#endif /*defined(DISPLAY_GRAPHICVFD) && !defined(DISPLAY_TEXTVFD)*/
85  }
86  
87 +#if defined(DISPLAY_TEXTVFD)
88 +void eDBoxLCD::updates(ePoint start,char *text)
89 +{
90 +       if((lcdfd >= 0) && (start.y() < 5))
91 +       {
92 +               int i = 0, text_len = strlen(text);
93 +               for(; i<text_len ; i++)
94 +               {
95 +                       if(text[i]==0x0a) text[i] = 0x20;
96 +               }
97 +               write(lcdfd, text, text_len);
98 +       }
99 +}
100 +#endif /*defined(DISPLAY_TEXTVFD)*/
101 diff --git a/lib/gdi/lcd.h b/lib/gdi/lcd.h
102 index e7b4c2c..80a56f2 100644
103 --- a/lib/gdi/lcd.h
104 +++ b/lib/gdi/lcd.h
105 @@ -36,6 +36,9 @@ public:
106         int stride() { return _stride; }
107         eSize size() { return res; }
108         virtual void update()=0;
109 +#if defined(DISPLAY_TEXTVFD)
110 +       virtual void updates(ePoint start,char *text) = 0;
111 +#endif /*defined(DISPLAY_TEXTVFD)*/
112  #endif
113  };
114  
115 @@ -59,6 +62,9 @@ public:
116         void setInverted( unsigned char );
117         bool isOled() const { return !!is_oled; }
118         void update();
119 +#if defined(DISPLAY_TEXTVFD)
120 +       void updates(ePoint start,char *text);
121 +#endif /*defined(DISPLAY_TEXTVFD)*/
122  };
123  
124  #endif