Merge branch 'bug_124_m2ts_support' into experimental
authorghost <andreas.monzner@multimedia-labs.de>
Tue, 21 Dec 2010 10:47:08 +0000 (11:47 +0100)
committerghost <andreas.monzner@multimedia-labs.de>
Tue, 21 Dec 2010 10:47:08 +0000 (11:47 +0100)
165 files changed:
.gitignore
COPYING [new file with mode: 0644]
Makefile.am
README
RecordTimer.py
acinclude.m4 [deleted file]
autogen.sh
config.h.in [deleted file]
configure.ac [changed mode: 0755->0644]
data/Makefile.am
data/defaults/Dream/Makefile.am
data/defaults/Dream/dm500hd.info
data/defaults/Dream/dm7020hd.info
data/defaults/Dream/dm7025.info
data/defaults/Dream/dm800.info
data/defaults/Dream/dm8000.info
data/defaults/Dream/dm800se.info
data/defaults/Dream/settings.c [new file with mode: 0644]
data/defaults/Dream/settings.t [new file with mode: 0644]
data/defaultsatlists.xml
data/fonts/Makefile.am
data/fonts/tuxtxt.ttf [new file with mode: 0644]
data/keymaps/Makefile.am [new file with mode: 0644]
data/keymaps/dream-de.info [new file with mode: 0644]
data/keymaps/dream-de.kmap [new file with mode: 0644]
data/keymaps/eng.info [new file with mode: 0644]
data/keymaps/eng.kmap [new file with mode: 0644]
data/setup.xml
data/skin_default.xml
data/skin_default/icons/Makefile.am
debug [deleted file]
debug.gdb [deleted file]
enigma2.bb [new file with mode: 0644]
enigma2.pc.in
include/Makefile.am
lib/actions/.gitignore [new file with mode: 0644]
lib/actions/Makefile.am
lib/actions/action.h
lib/actions/parseactions.py
lib/base/.gitignore [new file with mode: 0644]
lib/base/Makefile.am
lib/base/console.h
lib/base/eenv.cpp.in [new file with mode: 0644]
lib/base/eenv.h [new file with mode: 0644]
lib/base/encoding.cpp
lib/components/Makefile.am
lib/driver/Makefile.am
lib/driver/rcconsole.cpp
lib/driver/rcconsole.h
lib/driver/rcsdl.cpp [new file with mode: 0644]
lib/driver/rcsdl.h [new file with mode: 0644]
lib/dvb/Makefile.am
lib/dvb/db.cpp
lib/dvb/frontend.cpp
lib/dvb/lowlevel/Makefile.am
lib/dvb/pmt.cpp
lib/dvb/pmt.h
lib/dvb/pvrparse.cpp
lib/dvb/scan.cpp
lib/dvb/sec.cpp
lib/dvb/tstools.cpp
lib/dvb_ci/Makefile.am
lib/dvb_ci/dvbci.cpp
lib/gdi/Makefile.am
lib/gdi/epng.cpp
lib/gdi/font.cpp
lib/gdi/font.h
lib/gdi/gfbdc.cpp
lib/gdi/gfbdc.h
lib/gdi/glcddc.cpp
lib/gdi/glcddc.h
lib/gdi/gmaindc.cpp [new file with mode: 0644]
lib/gdi/gmaindc.h [new file with mode: 0644]
lib/gdi/grc.cpp
lib/gdi/grc.h
lib/gdi/lcd.cpp
lib/gdi/picload.cpp
lib/gdi/sdl.cpp
lib/gdi/sdl.h
lib/gui/Makefile.am
lib/gui/elistboxcontent.cpp
lib/gui/epositiongauge.cpp
lib/gui/esubtitle.h
lib/gui/ewidgetdesktop.cpp
lib/mmi/Makefile.am
lib/nav/Makefile.am
lib/python/.gitignore [new file with mode: 0644]
lib/python/Components/Harddisk.py [changed mode: 0755->0644]
lib/python/Components/Keyboard.py
lib/python/Components/NimManager.py
lib/python/Components/Renderer/Picon.py
lib/python/Components/TimerSanityCheck.py
lib/python/Components/UsageConfig.py
lib/python/Components/config.py
lib/python/Makefile.am
lib/python/Plugins/DemoPlugins/TPMDemo/Makefile.am
lib/python/Plugins/Extensions/DVDBurn/DVDProject.py
lib/python/Plugins/Extensions/DVDBurn/DreamboxDVD.ddvdp.xml
lib/python/Plugins/Extensions/DVDBurn/Text_menu_boat.ddvdm.xml
lib/python/Plugins/Extensions/DVDBurn/Thumbs_menu_clouds.ddvdm.xml
lib/python/Plugins/Extensions/DVDPlayer/Makefile.am
lib/python/Plugins/Extensions/DVDPlayer/plugin.py
lib/python/Plugins/Extensions/DVDPlayer/src/Makefile.am
lib/python/Plugins/Extensions/DVDPlayer/src/servicedvd.cpp
lib/python/Plugins/Extensions/Makefile.am
lib/python/Plugins/Extensions/SocketMMI/src/Makefile.am
lib/python/Plugins/SystemPlugins/CommonInterfaceAssignment/plugin.py
lib/python/Plugins/SystemPlugins/Hotplug/plugin.py
lib/python/Plugins/SystemPlugins/NFIFlash/downloader.py
lib/python/Plugins/SystemPlugins/NFIFlash/flasher.py
lib/python/Plugins/SystemPlugins/SkinSelector/plugin.py
lib/python/Plugins/SystemPlugins/SoftwareManager/BackupRestore.py
lib/python/Plugins/SystemPlugins/SoftwareManager/ImageWizard.py
lib/python/Plugins/SystemPlugins/SoftwareManager/plugin.py
lib/python/Plugins/SystemPlugins/TempFanControl/Makefile.am
lib/python/Plugins/SystemPlugins/WirelessLan/plugin.py
lib/python/Plugins/newplugin.py [changed mode: 0644->0755]
lib/python/Screens/AudioSelection.py
lib/python/Screens/ChannelSelection.py
lib/python/Screens/InfoBarGenerics.py
lib/python/Screens/Setup.py
lib/python/Screens/Wizard.py
lib/python/Tools/Directories.py
lib/python/Tools/NumericalTextInput.py
lib/python/connections.h
lib/python/enigma_python.i
lib/python/python.h
lib/service/Makefile.am
lib/service/iservice.h
lib/service/servicedvb.cpp
lib/service/servicemp3.cpp
lib/service/servicemp3.h
m4/.gitignore [new file with mode: 0644]
m4/ax_pkg_swig.m4 [new file with mode: 0644]
m4/ax_pthread.m4 [new file with mode: 0644]
m4/ax_python_devel.m4 [new file with mode: 0644]
m4/ax_swig_enable_cxx.m4 [new file with mode: 0644]
m4/ax_swig_python.m4 [new file with mode: 0644]
m4/tuxbox.m4 [new file with mode: 0644]
main/.gitignore
main/Makefile.am
main/bsod.cpp [changed mode: 0755->0644]
main/enigma-gdi.cpp
main/enigma-gui.cpp
main/enigma.cpp
main/version_info.cpp [new file with mode: 0644]
main/version_info.h [new file with mode: 0644]
main/xmlgenerator.cpp [new file with mode: 0644]
main/xmlgenerator.h [new file with mode: 0644]
mytest.py
po/.gitignore [new file with mode: 0644]
po/LINGUAS [deleted file]
po/Makefile.am [changed mode: 0755->0644]
po/enigma2.pot [deleted file]
po/et.po
po/fi.po
po/is.po
po/lt.po
po/pl.po
po/sk.po
po/sv.po
skin.py
tools/.gitignore [new file with mode: 0644]
tools/Makefile.am
tools/enigma2.sh.in [new file with mode: 0755]

index 274231a..da59fcf 100644 (file)
@@ -2,16 +2,8 @@
 # Lines that start with '#' are comments.
 # For a project mostly in C, the following would be a good set of
 # exclude patterns (uncomment them if you want to use them):
-*.[oa]
 *~
-Makefile.in
-Makefile
-*.so
-*.so.0.0
-*.cxx
-.deps
-COPYING
-INSTALL
+*.a
 aclocal.m4
 autom4te.cache/
 config.guess
@@ -20,22 +12,24 @@ config.status
 config.sub
 configure
 depcomp
+.deps/
+enigma2_config.h
+enigma2_config.h.in
 enigma2.pc
+index-enigma2.xml
+INSTALL
 install-sh
-lib/actions/actionids.h
-lib/python/Plugins/Extensions/DVDPlayer/src/servicedvd.d
-lib/python/enigma.py
-missing
-py-compile
-po/
-main/enigma2
-version.h
-*.d
 *.la
-*.lo
 .libs/
-*.tar.gz
-config.h
 libtool
+*.lo
 ltmain.sh
+Makefile
+Makefile.in
+missing
+moc_*.cpp
+*.o
+py-compile
 stamp-h1
+*.tar.bz2
+*.tar.gz
diff --git a/COPYING b/COPYING
new file mode 100644 (file)
index 0000000..322cb19
--- /dev/null
+++ b/COPYING
@@ -0,0 +1 @@
+See LICENSE.
index bc1770b..ff252e6 100755 (executable)
@@ -1,14 +1,21 @@
 SUBDIRS = include lib main data po tools
 
-installdir = $(pkglibdir)/python
+ACLOCAL_AMFLAGS = -I m4
 
+installdir = $(pkglibdir)/python
 install_PYTHON = \
        Navigation.py NavigationInstance.py RecordTimer.py SleepTimer.py ServiceReference.py \
        keyids.py keymapparser.py mytest.py skin.py timer.py tools.py GlobalActions.py \
        e2reactor.py
 
-install-exec-hook:
-               $(PYTHON) $(srcdir)/tools/genmetaindex.py $(DESTDIR)$(datadir)/meta/plugin_*.xml > $(DESTDIR)$(datadir)/meta/index-enigma2.xml
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = enigma2.pc
+
+metadir = $(datadir)/meta
+meta_DATA = index-enigma2.xml
+CLEANFILES = index-enigma2.xml
+
+EXTRA_DIST = lamedb
 
-uninstall-hook:
-       $(RM) $(DESTDIR)$(datadir)/meta/index-enigma2.xml
+index-enigma2.xml: $(top_srcdir)/tools/genmetaindex.py $(top_srcdir)/lib/python/Plugins/*/*/meta/plugin_*.xml
+       $(AM_V_GEN)$(PYTHON) $^ > $@
diff --git a/README b/README
index e69de29..f745e9c 100644 (file)
--- a/README
+++ b/README
@@ -0,0 +1,59 @@
+To build enigma2 on Ubuntu 10.04, follow these steps:
+
+0.) Consider using OE to build it for a Dreambox instead.
+
+    To build this version for a Dreambox, you will need
+    a recent OE (branch "opendreambox-1.6" will do, but "3.0" won't)
+    or at least a backported BitBake recipe from there.
+
+    See http://opendreambox.org/.
+
+    Stop reading here. It's not very useful for most people
+    to build enigma2 for a PC.
+
+1.) Install these packages:
+
+autoconf
+automake
+build-essential
+gettext
+libfreetype6-dev
+libfribidi-dev
+libgif-dev
+libgstreamer0.10-dev
+libgstreamer-plugins-base0.10-dev
+libjpeg62-dev
+libpng12-dev
+libsdl1.2-dev
+libsigc++-1.2-dev
+libtool
+libxml2-dev
+libxslt1-dev
+python-dev
+swig
+
+2.) Build and install libdvbsi++:
+
+git clone git://git.opendreambox.org/git/obi/libdvbsi++.git
+cd libdvbsi++
+dpkg-buildpackage -uc -us
+cd ..
+sudo dpkg -i libdvbsi++*.deb
+
+3.) Build and install libxmlccwrap:
+
+git clone git://git.opendreambox.org/git/obi/libxmlccwrap.git
+cd libxmlccwrap
+dpkg-buildpackage -uc -us
+cd ..
+sudo dpkg -i libxmlccwrap*.deb
+
+4.) Build and install enigma2:
+
+git clone git://git.opendreambox.org/git/enigma2.git
+cd enigma2
+autoreconf -i
+./configure --prefix=$HOME/enigma2 --with-libsdl
+make
+make install
+
index 4ece9c5..1cb7eb3 100755 (executable)
@@ -517,7 +517,7 @@ class RecordTimer(timer.Timer):
                checkit = True
                for timer in root.findall("timer"):
                        newTimer = createTimer(timer)
-                       if (self.record(newTimer, True, True) is not None) and (checkit == True):
+                       if (self.record(newTimer, True, dosave=False) is not None) and (checkit == True):
                                from Tools.Notifications import AddPopup
                                from Screens.MessageBox import MessageBox
                                AddPopup(_("Timer overlap in timers.xml detected!\nPlease recheck it!"), type = MessageBox.TYPE_ERROR, timeout = 0, id = "TimerLoadFailed")
diff --git a/acinclude.m4 b/acinclude.m4
deleted file mode 100644 (file)
index 6f1cb0a..0000000
+++ /dev/null
@@ -1,445 +0,0 @@
-AC_DEFUN([TUXBOX_APPS],[
-
-INSTALL="$INSTALL -p"
-
-AC_GNU_SOURCE
-AC_SYS_LARGEFILE
-
-AC_ARG_WITH(target,
-       [  --with-target=TARGET    target for compilation [[native,cdk]]],
-       [TARGET="$withval"],[TARGET="native"])
-
-AC_ARG_WITH(targetprefix,
-       [  --with-targetprefix=PATH  prefix relative to target root (only applicable in cdk mode)],
-       [targetprefix="$withval"],[targetprefix="NONE"])
-
-AC_ARG_WITH(debug,
-       [  --without-debug         disable debugging code],
-       [DEBUG="$withval"],[DEBUG="yes"])
-
-if test "$DEBUG" = "yes"; then
-       DEBUG_CFLAGS="-g3 -ggdb"
-       AC_DEFINE(DEBUG,1,[Enable debug messages])
-fi
-
-AC_MSG_CHECKING(target)
-
-if test "$TARGET" = "native"; then
-       AC_MSG_RESULT(native)
-
-       if test "$CFLAGS" = "" -a "$CXXFLAGS" = ""; then
-               CFLAGS="-Wall -O2 -pipe $DEBUG_CFLAGS"
-               CXXFLAGS="-Wall -O2 -pipe $DEBUG_CFLAGS"
-       fi
-       if test "$prefix" = "NONE"; then
-               prefix=/usr/local
-       fi
-       targetprefix=$prefix
-elif test "$TARGET" = "cdk"; then
-       AC_MSG_RESULT(cdk)
-
-       if test "$CC" = "" -a "$CXX" = ""; then
-               CC=powerpc-tuxbox-linux-gnu-gcc CXX=powerpc-tuxbox-linux-gnu-g++
-       fi
-       if test "$CFLAGS" = "" -a "$CXXFLAGS" = ""; then
-               CFLAGS="-Wall -Os -mcpu=823 -pipe $DEBUG_CFLAGS"
-               CXXFLAGS="-Wall -Os -mcpu=823 -pipe $DEBUG_CFLAGS"
-       fi
-       if test "$prefix" = "NONE"; then
-               AC_MSG_ERROR(invalid prefix, you need to specify one in cdk mode)
-       fi
-       if test "$targetprefix" = "NONE"; then
-               targetprefix=""
-       fi
-       if test "$host_alias" = ""; then
-               cross_compiling=yes
-               host_alias=powerpc-tuxbox-linux-gnu
-       fi
-else
-       AC_MSG_RESULT(none)
-       AC_MSG_ERROR([invalid target $TARGET, choose on from native,cdk]);
-fi
-
-AC_CANONICAL_BUILD
-AC_CANONICAL_HOST
-
-check_path () {
-       return $(perl -e "if(\"$1\"=~m#^/usr/(local/)?bin#){print \"0\"}else{print \"1\";}")
-}
-
-])
-
-AC_DEFUN([TUXBOX_APPS_DIRECTORY_ONE],[
-AC_ARG_WITH($1,[  $6$7 [[PREFIX$4$5]]],[
-       _$2=$withval
-       if test "$TARGET" = "cdk"; then
-               $2=`eval echo "${targetprefix}$withval"`
-       else
-               $2=$withval
-       fi
-],[
-       $2="\${$3}$5"
-       if test "$TARGET" = "cdk"; then
-               _$2=`eval echo "${target$3}$5"`
-       else
-               _$2=`eval echo "${$3}$5"`
-       fi
-])
-
-dnl automake <= 1.6 don't support this
-dnl AC_SUBST($2)
-AC_DEFINE_UNQUOTED($2,"$_$2",$7)
-])
-
-AC_DEFUN([TUXBOX_APPS_DIRECTORY],[
-AC_REQUIRE([TUXBOX_APPS])
-
-if test "$TARGET" = "cdk"; then
-       datadir="\${prefix}/share"
-       tuxboxdatadir="\${prefix}/share/tuxbox"
-       zoneinfodir="\${datadir}/zoneinfo"
-       sysconfdir="\${prefix}/etc"
-       localstatedir="\${prefix}/var"
-       localedir="\${prefix}/var"
-       libdir="\${prefix}/lib"
-       targetdatadir="\${targetprefix}/share"
-       targetsysconfdir="\${targetprefix}/etc"
-       targetlocalstatedir="\${targetprefix}/var"
-       targetlibdir="\${targetprefix}/lib"
-fi
-
-TUXBOX_APPS_DIRECTORY_ONE(configdir,CONFIGDIR,sysconfdir,/etc,,
-       [--with-configdir=PATH   ],[where to find the config files])
-
-TUXBOX_APPS_DIRECTORY_ONE(datadir,DATADIR,datadir,/share,,
-       [--with-datadir=PATH     ],[where to find data])
-
-TUXBOX_APPS_DIRECTORY_ONE(fontdir,FONTDIR,datadir,/share,/fonts,
-       [--with-fontdir=PATH     ],[where to find the fonts])
-
-TUXBOX_APPS_DIRECTORY_ONE(libdir,LIBDIR,libdir,/lib,,
-       [--with-libdir=PATH      ],[where to find the internal libs])
-])
-
-dnl automake <= 1.6 needs this specifications
-AC_SUBST(CONFIGDIR)
-AC_SUBST(DATADIR)
-AC_SUBST(FONTDIR)
-AC_SUBST(LIBDIR)
-dnl end workaround
-
-AC_DEFUN([TUXBOX_APPS_DVB],[
-AC_ARG_WITH(dvbincludes,
-       [  --with-dvbincludes=PATH  path for dvb includes [[NONE]]],
-       [DVBINCLUDES="$withval"],[DVBINCLUDES=""])
-
-if test "$DVBINCLUDES"; then
-       CPPFLAGS="$CPPFLAGS -I$DVBINCLUDES"
-fi
-
-AC_CHECK_HEADERS(ost/dmx.h,[
-       DVB_API_VERSION=1
-       AC_MSG_NOTICE([found dvb version 1])
-])
-
-if test -z "$DVB_API_VERSION"; then
-AC_CHECK_HEADERS(linux/dvb/version.h,[
-       AC_LANG_PREPROC_REQUIRE()
-       AC_REQUIRE([AC_PROG_EGREP])
-       AC_LANG_CONFTEST([AC_LANG_SOURCE([[
-#include <linux/dvb/version.h>
-version DVB_API_VERSION
-       ]])])
-       DVB_API_VERSION=`(eval "$ac_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD | $EGREP "^version" | sed "s,version\ ,,"`
-       rm -f conftest*
-
-       AC_MSG_NOTICE([found dvb version $DVB_API_VERSION])
-])
-fi
-
-if test "$DVB_API_VERSION"; then
-       AC_DEFINE(HAVE_DVB,1,[Define to 1 if you have the dvb includes])
-       AC_DEFINE_UNQUOTED(HAVE_DVB_API_VERSION,$DVB_API_VERSION,[Define to the version of the dvb api])
-else
-       AC_MSG_ERROR([can't find dvb headers])
-fi
-])
-
-AC_DEFUN([_TUXBOX_APPS_LIB_CONFIG],[
-AC_PATH_PROG($1_CONFIG,$2,no)
-if test "$$1_CONFIG" != "no"; then
-       if test "$TARGET" = "cdk" && check_path "$$1_CONFIG"; then
-               AC_MSG_$3([could not find a suitable version of $2]);
-       else
-               $1_CFLAGS=$($$1_CONFIG --cflags)
-               $1_LIBS=$($$1_CONFIG --libs)
-       fi
-fi
-
-AC_SUBST($1_CFLAGS)
-AC_SUBST($1_LIBS)
-])
-
-AC_DEFUN([TUXBOX_APPS_LIB_CONFIG],[
-_TUXBOX_APPS_LIB_CONFIG($1,$2,ERROR)
-if test "$$1_CONFIG" = "no"; then
-       AC_MSG_ERROR([could not find $2]);
-fi
-])
-
-AC_DEFUN([TUXBOX_APPS_LIB_CONFIG_CHECK],[
-_TUXBOX_APPS_LIB_CONFIG($1,$2,WARN)
-])
-
-AC_DEFUN([TUXBOX_APPS_PKGCONFIG],[
-AC_PATH_PROG(PKG_CONFIG, pkg-config,no)
-if test "$PKG_CONFIG" = "no" ; then
-       AC_MSG_ERROR([could not find pkg-config]);
-fi
-])
-
-AC_DEFUN([_TUXBOX_APPS_LIB_PKGCONFIG],[
-PKG_CHECK_MODULES($1,$2)
-AC_SUBST($1_CFLAGS)
-AC_SUBST($1_LIBS)
-])
-
-AC_DEFUN([_TUXBOX_APPS_LIB_PKGCONFIG_OPTIONAL],[
-PKG_CHECK_MODULES($1,$2,$3="yes",$3="no")
-if test "$$3" = "yes"; then
-       AC_DEFINE($3, 1, [$2 available])
-else
-       $1_CFLAGS=""
-       $1_LIBS=""
-fi
-AC_SUBST($1_CFLAGS)
-AC_SUBST($1_LIBS)
-])
-
-AC_DEFUN([TUXBOX_APPS_LIB_PKGCONFIG],[
-_TUXBOX_APPS_LIB_PKGCONFIG($1,$2)
-if test -z "$$1_CFLAGS" ; then
-       AC_MSG_ERROR([could not find package $2]);
-fi
-])
-
-AC_DEFUN([TUXBOX_APPS_LIB_PKGCONFIG_CHECK],[
-_TUXBOX_APPS_LIB_PKGCONFIG($1,$2)
-])
-
-AC_DEFUN([_TUXBOX_APPS_LIB_SYMBOL],[
-AC_CHECK_LIB($2,$3,HAVE_$1="yes",HAVE_$1="no")
-if test "$HAVE_$1" = "yes"; then
-       $1_LIBS=-l$2
-fi
-
-AC_SUBST($1_LIBS)
-])
-
-AC_DEFUN([TUXBOX_APPS_LIB_SYMBOL],[
-_TUXBOX_APPS_LIB_SYMBOL($1,$2,$3,ERROR)
-if test "$HAVE_$1" = "no"; then
-       AC_MSG_ERROR([could not find $2]);
-fi
-])
-
-AC_DEFUN([TUXBOX_APPS_LIB_CONFIG_SYMBOL],[
-_TUXBOX_APPS_LIB_SYMBOL($1,$2,$3,WARN)
-])
-
-AC_DEFUN([TUXBOX_APPS_GETTEXT],[
-AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
-       [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1 &&
-       (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
-       :)
-AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
-
-AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
-       [$ac_dir/$ac_word --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 &&
-       (if $ac_dir/$ac_word --omit-header --copyright-holder= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
-       :)
-
-AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,[$ac_dir/$ac_word --update -q /dev/null /dev/null >/dev/null 2>&1],:)
-
-AC_MSG_CHECKING([whether NLS is requested])
-AC_ARG_ENABLE(nls,
-       [  --disable-nls           do not use Native Language Support],
-       USE_NLS=$enableval, USE_NLS=yes)
-AC_MSG_RESULT($USE_NLS)
-AC_SUBST(USE_NLS)
-
-if test "$USE_NLS" = "yes"; then
-       AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,[
-               AC_TRY_LINK([
-                       #include <libintl.h>
-                       #ifndef __GNU_GETTEXT_SUPPORTED_REVISION
-                       #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
-                       #endif
-                       extern int _nl_msg_cat_cntr;
-                       extern int *_nl_domain_bindings;
-                       ],[
-                       bindtextdomain ("", "");
-                       return (int) gettext ("") + _nl_msg_cat_cntr + *_nl_domain_bindings;
-                       ], gt_cv_func_gnugettext_libc=yes, gt_cv_func_gnugettext_libc=no
-               )]
-       )
-
-       if test "$gt_cv_func_gnugettext_libc" = "yes"; then
-               AC_DEFINE(ENABLE_NLS, 1, [Define to 1 if translation of program messages to the user's native language is requested.])
-               gt_use_preinstalled_gnugettext=yes
-       else
-               USE_NLS=no
-       fi
-fi
-
-if test -f "$srcdir/po/LINGUAS"; then
-       ALL_LINGUAS=$(sed -e "/^#/d" "$srcdir/po/LINGUAS")
-fi
-
-POFILES=
-GMOFILES=
-UPDATEPOFILES=
-DUMMYPOFILES=
-for lang in $ALL_LINGUAS; do
-       POFILES="$POFILES $srcdirpre$lang.po"
-       GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
-       UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
-       DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
-done
-INST_LINGUAS=
-if test -n "$ALL_LINGUAS"; then
-       for presentlang in $ALL_LINGUAS; do
-               useit=no
-               if test -n "$LINGUAS"; then
-                       desiredlanguages="$LINGUAS"
-               else
-                       desiredlanguages="$ALL_LINGUAS"
-               fi
-               for desiredlang in $desiredlanguages; do
-                       case "$desiredlang" in
-                               "$presentlang"*) useit=yes;;
-                       esac
-               done
-               if test $useit = yes; then
-                       INST_LINGUAS="$INST_LINGUAS $presentlang"
-               fi
-       done
-fi
-CATALOGS=
-if test -n "$INST_LINGUAS"; then
-       for lang in $INST_LINGUAS; do
-               CATALOGS="$CATALOGS $lang.gmo"
-       done
-fi
-AC_SUBST(POFILES)
-AC_SUBST(GMOFILES)
-AC_SUBST(UPDATEPOFILES)
-AC_SUBST(DUMMYPOFILES)
-AC_SUBST(CATALOGS)
-])
-
-dnl backward compatiblity
-AC_DEFUN([AC_GNU_SOURCE],
-[AH_VERBATIM([_GNU_SOURCE],
-[/* Enable GNU extensions on systems that have them.  */
-#ifndef _GNU_SOURCE
-# undef _GNU_SOURCE
-#endif])dnl
-AC_BEFORE([$0], [AC_COMPILE_IFELSE])dnl
-AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
-AC_DEFINE([_GNU_SOURCE])
-])
-
-AC_DEFUN([AC_PROG_EGREP],
-[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep],
-   [if echo a | (grep -E '(a|b)') >/dev/null 2>&1
-    then ac_cv_prog_egrep='grep -E'
-    else ac_cv_prog_egrep='egrep'
-    fi])
- EGREP=$ac_cv_prog_egrep
- AC_SUBST([EGREP])
-])
-
-AC_DEFUN([AC_PYTHON_DEVEL],[
-       #
-       # should allow for checking of python version here...
-       #
-       if test $cross_compiling = "yes"; then
-               # Check for Python include path
-               AC_MSG_CHECKING([for Python include path])
-               
-               # FIXME: yes, this is wrong. sorry about that. (tmbinc)
-               cross_PYTHON_VERSION=$PYTHON_VERSION
-               python_path=
-               for i in $CPPFLAGS ; do
-                       p=`echo $i | sed "s,^-I,,"`
-                       p=`echo $p | sed "s,^-isystem,,"`
-                       if test -f "$p/python$cross_PYTHON_VERSION/Python.h"; then
-                               python_path="$p/python$cross_PYTHON_VERSION"
-                               break
-                       fi
-               done
-               AC_MSG_RESULT([$python_path])
-               if test -z "$python_path" ; then
-                                               AC_MSG_ERROR([cannot find Python include path])
-               fi
-               AC_SUBST([PYTHON_CPPFLAGS],[-I$python_path])
-
-               # Check for Python library path
-               AC_MSG_CHECKING([for Python library path])
-               python_path=
-               for i in $LDFLAGS; do
-                       l=`echo $i | sed "s,^-L,,"`
-                       python_path=`find $l -type f -name libpython$cross_PYTHON_VERSION.* -print | sed "1q"`
-                       if test -n "$python_path" ; then
-                               break
-                       fi
-               done
-               python_path=`echo $python_path | sed "s,/libpython.*$,,"`
-               AC_MSG_RESULT([$python_path])
-               if test -z "$python_path" ; then
-                                               AC_MSG_ERROR([cannot find Python library path])
-               fi
-               AC_SUBST([PYTHON_LDFLAGS],["-L$python_path -lpython$cross_PYTHON_VERSION"])
-               #
-               python_site=`echo $python_path | sed "s/config/site-packages/"`
-               AC_SUBST([PYTHON_SITE_PKG],[$python_site])
-       else
-               AC_REQUIRE([AM_PATH_PYTHON])
-
-               # Check for Python include path
-               AC_MSG_CHECKING([for Python include path])
-               python_path=`echo $PYTHON | sed "s,/bin.*$,,"`
-               for i in "$python_path/include/python$PYTHON_VERSION/" "$python_path/include/python/" "$python_path/" ; do
-                       python_path=`find $i -type f -name Python.h -print | sed "1q"`
-                       if test -n "$python_path" ; then
-                               break
-                       fi
-               done
-               python_path=`echo $python_path | sed "s,/Python.h$,,"`
-               AC_MSG_RESULT([$python_path])
-               if test -z "$python_path" ; then
-                       AC_MSG_ERROR([cannot find Python include path])
-               fi
-               AC_SUBST([PYTHON_CPPFLAGS],[-I$python_path])
-
-               # Check for Python library path
-               AC_MSG_CHECKING([for Python library path])
-               python_path=`echo $PYTHON | sed "s,/bin.*$,,"`
-               for i in "$python_path/lib/python$PYTHON_VERSION/config/" "$python_path/lib/python$PYTHON_VERSION/" "$python_path/lib/python/config/" "$python_path/lib/python/" "$python_path/" ; do
-                       python_path=`find $i -type f -name libpython$PYTHON_VERSION.* -print | sed "1q"`
-                       if test -n "$python_path" ; then
-                               break
-                       fi
-               done
-               python_path=`echo $python_path | sed "s,/libpython.*$,,"`
-               AC_MSG_RESULT([$python_path])
-               if test -z "$python_path" ; then
-                       AC_MSG_ERROR([cannot find Python library path])
-               fi
-               AC_SUBST([PYTHON_LDFLAGS],["-L$python_path -lpython$PYTHON_VERSION"])
-               #
-               python_site=`echo $python_path | sed "s/config/site-packages/"`
-               AC_SUBST([PYTHON_SITE_PKG],[$python_site])
-       fi
-])
index 584a74e..68f4a17 100755 (executable)
@@ -1,60 +1,2 @@
 #!/bin/sh
-
-package="enigma2"
-
-srcdir=`dirname $0`
-test -z "$srcdir" && srcdir=.
-
-cd "$srcdir"
-DIE=0
-
-(autoconf --version) < /dev/null > /dev/null 2>&1 || {
-       echo
-       echo "You must have autoconf installed to compile $package."
-       echo "Download the appropriate package for your system,"
-       echo "or get the source from one of the GNU ftp sites"
-       echo "listed in http://www.gnu.org/order/ftp.html"
-       DIE=1
-}
-
-(automake --version) < /dev/null > /dev/null 2>&1 || {
-       echo
-       echo "You must have automake installed to compile $package."
-       echo "Download the appropriate package for your system,"
-       echo "or get the source from one of the GNU ftp sites"
-       echo "listed in http://www.gnu.org/order/ftp.html"
-       DIE=1
-}
-
-(libtool --version) < /dev/null > /dev/null 2>&1 || {
-       echo
-       echo "You must have libtool installed to compile $package."
-       echo "Download the appropriate package for your system,"
-       echo "or get the source from one of the GNU ftp sites"
-       echo "listed in http://www.gnu.org/order/ftp.html"
-       DIE=1
-}
-
-if test "$DIE" -eq 1; then
-       exit 1
-fi
-
-if [ ! -e acinclude.m4 ]; then
-       for i in .. ../.. ../../..; do
-               if [ -e `pwd`/$i/acinclude.m4 ]; then
-                       ln -s `pwd`/$i/acinclude.m4 .
-               fi
-       done
-fi
-
-echo "Generating configuration files for $package, please wait...."
-
-echo "  aclocal"
-aclocal
-echo "  libtoolize --automake"
-libtoolize --automake
-echo "  autoconf"
-autoconf
-echo "  automake --add-missing"
-automake --add-missing 
-
+autoreconf -i
diff --git a/config.h.in b/config.h.in
deleted file mode 100644 (file)
index 3564836..0000000
+++ /dev/null
@@ -1,112 +0,0 @@
-/* config.h.in.  Generated from configure.ac by autoheader.  */
-
-/* where to find the config files */
-#undef CONFIGDIR
-
-/* where to find data */
-#undef DATADIR
-
-/* Enable debug messages */
-#undef DEBUG
-
-/* Define to 1 if translation of program messages to the user's native
-   language is requested. */
-#undef ENABLE_NLS
-
-/* where to find the fonts */
-#undef FONTDIR
-
-/* where games data is stored */
-#undef GAMESDIR
-
-/* Define to 1 if you have the dvb includes */
-#undef HAVE_DVB
-
-/* Define to the version of the dvb api */
-#undef HAVE_DVB_API_VERSION
-
-/* Define to 1 if you have the <inttypes.h> header file. */
-#undef HAVE_INTTYPES_H
-
-/* Define to 1 if you have the <linux/dvb/version.h> header file. */
-#undef HAVE_LINUX_DVB_VERSION_H
-
-/* Define to 1 if you have the <memory.h> header file. */
-#undef HAVE_MEMORY_H
-
-/* Define to 1 if you have the <ost/dmx.h> header file. */
-#undef HAVE_OST_DMX_H
-
-/* Define to 1 if you have the <stdint.h> header file. */
-#undef HAVE_STDINT_H
-
-/* Define to 1 if you have the <stdlib.h> header file. */
-#undef HAVE_STDLIB_H
-
-/* Define to 1 if you have the <strings.h> header file. */
-#undef HAVE_STRINGS_H
-
-/* Define to 1 if you have the <string.h> header file. */
-#undef HAVE_STRING_H
-
-/* Define to 1 if you have the <sys/stat.h> header file. */
-#undef HAVE_SYS_STAT_H
-
-/* Define to 1 if you have the <sys/types.h> header file. */
-#undef HAVE_SYS_TYPES_H
-
-/* Define to 1 if you have the <unistd.h> header file. */
-#undef HAVE_UNISTD_H
-
-/* where to find the internal libs */
-#undef LIBDIR
-
-/* where to find locales */
-#undef LOCALEDIR
-
-/* Name of package */
-#undef PACKAGE
-
-/* Define to the address where bug reports for this package should be sent. */
-#undef PACKAGE_BUGREPORT
-
-/* Define to the full name of this package. */
-#undef PACKAGE_NAME
-
-/* Define to the full name and version of this package. */
-#undef PACKAGE_STRING
-
-/* Define to the one symbol short name of this package. */
-#undef PACKAGE_TARNAME
-
-/* Define to the version of this package. */
-#undef PACKAGE_VERSION
-
-/* where to find the plugins */
-#undef PLUGINDIR
-
-/* Define to 1 if you have the ANSI C header files. */
-#undef STDC_HEADERS
-
-/* where to find tuxbox data */
-#undef TUXBOXDATADIR
-
-/* Version number of package */
-#undef VERSION
-
-/* With SDL */
-#undef WITH_SDL
-
-/* where to find zoneinfo db */
-#undef ZONEINFODIR
-
-/* Number of bits in a file offset, on hosts where this is settable. */
-#undef _FILE_OFFSET_BITS
-
-/* Enable GNU extensions on systems that have them.  */
-#ifndef _GNU_SOURCE
-# undef _GNU_SOURCE
-#endif
-
-/* Define for large files, on AIX-style hosts. */
-#undef _LARGE_FILES
old mode 100755 (executable)
new mode 100644 (file)
index 35fad77..0c54f5b
-AC_INIT(enigma2,2.4)
-AM_INIT_AUTOMAKE(enigma2,2.4)
+AC_INIT([enigma2],[3.0.0],[enigma2-devel@lists.elitedvb.net])
+AM_INIT_AUTOMAKE([dist-bzip2 no-define tar-pax -Wno-portability])
+AC_CONFIG_HEADERS([enigma2_config.h])
 
-TUXBOX_APPS
-TUXBOX_APPS_DIRECTORY
+# Silent rules are available since 1.11, but older versions
+# are still in use. So don't use them unconditionally.
+m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
+
+AC_USE_SYSTEM_EXTENSIONS
+AC_SYS_LARGEFILE
 
 AC_PROG_CC
 AC_PROG_CXX
-AC_PROG_RANLIB
+m4_ifdef([LT_INIT], [LT_INIT], [AC_PROG_LIBTOOL])
+AC_CONFIG_MACRO_DIR([m4])
+
+AC_CHECK_HEADERS([dbox/fp.h dbox/lcd-ks0713.h])
+
+AC_PATH_PROG(MSGFMT, msgfmt, AC_MSG_ERROR(Could not find msgfmt))
+
+AM_PATH_PYTHON
+AX_PYTHON_DEVEL
+AX_PKG_SWIG
+AX_SWIG_ENABLE_CXX
+AX_SWIG_PYTHON
+AX_PTHREAD
+
+TUXBOX_APPS_DVB
+
+AM_CONDITIONAL(HAVE_GIT_DIR, test -d "$srcdir/.git")
+AM_CONDITIONAL(HAVE_FAKE_GIT_DIR, test -f "$srcdir/.git/last_commit_info")
+
+PKG_CHECK_MODULES(BASE, [freetype2 fribidi gstreamer-0.10 gstreamer-pbutils-0.10 libdvbsi++ libpng libxml-2.0 sigc++-1.2])
+PKG_CHECK_MODULES(LIBDDVD, libdreamdvd, HAVE_LIBDDVD="yes", HAVE_LIBDDVD="no")
+AM_CONDITIONAL(HAVE_LIBDDVD, test "$HAVE_LIBDDVD" = "yes")
+
+AC_CHECK_LIB([dl], [dlopen], [LIBDL_LIBS="-ldl"], [AC_MSG_ERROR([Could not find libdl])])
+AC_SUBST(LIBDL_LIBS)
+AC_CHECK_LIB([jpeg], [jpeg_set_defaults], [LIBJPEG_LIBS="-ljpeg"], [AC_MSG_ERROR([Could not find libjpeg])])
+AC_SUBST(LIBJPEG_LIBS)
+AC_CHECK_LIB([ungif], [DGifOpen], [LIBGIF_LIBS="-lungif"], [AC_CHECK_LIB([gif], [DGifOpen], [LIBGIF_LIBS="-lgif"], [AC_MSG_ERROR([Could not find libgif or libungif])])])
+AC_SUBST(LIBGIF_LIBS)
+
+AC_LANG_PUSH([C++])
+AC_CHECK_LIB([xmlccwrap], [exit], [LIBXMLCCWRAP_LIBS="-lxmlccwrap"], [AC_MSG_ERROR([Could not find libxmlccwrap])])
+AC_SUBST(LIBXMLCCWRAP_LIBS)
+AC_LANG_POP
 
 AC_ARG_WITH(libsdl,
-       AC_HELP_STRING([--with-libsdl], [use sdl, yes or no]),
-       [[withsdl=$withval]],
-       [[withsdl=yes]]
-)
-
-AC_CHECK_HEADER(dreamdvd/ddvdlib.h,have_ddvdlib="yes",have_ddvdlib="no")
-if test x"${have_ddvdlib}" = xyes ; then
-       AC_DEFINE(HAVE_DDVDLIB, 1,[Define if ddvdlib is available])
-else
-       AC_MSG_NOTICE([ddvdlib not found... dont build dvd plugin])
+       AS_HELP_STRING([--with-libsdl],[use libsdl, yes or no]),
+       [with_libsdl=$withval],[with_libsdl=no])
+if test "$with_libsdl" = "yes"; then
+       PKG_CHECK_MODULES(LIBSDL, sdl)
 fi
-AM_CONDITIONAL(HAVE_DDVDLIB, test "$have_ddvdlib" = "yes")
+AM_CONDITIONAL(HAVE_LIBSDL, test "$with_libsdl" = "yes")
 
-AM_PATH_PYTHON()
-AC_PYTHON_DEVEL
-#AM_PATH_XINE(1.1.0,, AC_MSG_ERROR([*** Please install xine-lib (devel) first ***]))
+AC_ARG_WITH(libxine,
+       AS_HELP_STRING([--with-libxine],[use libxine, yes or no]),
+       [with_libxine=$withval],[with_libxine=no])
+if test "$with_libxine" = "yes"; then
+       PKG_CHECK_MODULES(LIBXINE, libxine)
+       AC_DEFINE([WITH_XINE],[1],[Define to 1 if you have libxine])
+fi
+AM_CONDITIONAL(HAVE_LIBXINE, test "$with_libxine" = "yes")
 
-TUXBOX_APPS_DVB
+AC_ARG_WITH(debug,
+       AS_HELP_STRING([--without-debug],[disable debugging code]),
+       [with_debug="$withval"],[with_debug="yes"])
+if test "$with_debug" = "yes"; then
+       DEBUG_CFLAGS="-ggdb3"
+       AC_DEFINE([DEBUG],[1],[Define to 1 to enable debugging code])
+fi
 
-_TUXBOX_APPS_LIB_PKGCONFIG_OPTIONAL(FREETYPE, freetype2, HAVE_FREETYPE2)
-if test "$HAVE_FREETYPE2" = "no" ; then
-       TUXBOX_APPS_LIB_CONFIG(FREETYPE, freetype-config)
+AC_ARG_WITH(memcheck,
+       AS_HELP_STRING([--with-memcheck],[enable memory leak checks]),
+       [with_memcheck="$withval"],[with_memcheck="no"])
+if test "$with_memcheck" = "yes"; then
+       AC_DEFINE([MEMLEAK_CHECK],[1],[Define to 1 to enable memory leak checks])
 fi
-TUXBOX_APPS_LIB_PKGCONFIG(FRIBIDI,fribidi)
-TUXBOX_APPS_LIB_PKGCONFIG(ID3TAG,id3tag)
-TUXBOX_APPS_LIB_PKGCONFIG(MAD,mad)
-#TUXBOX_APPS_LIB_PKGCONFIG(PLUGINS,tuxbox-plugins)
-TUXBOX_APPS_LIB_PKGCONFIG(PNG,libpng)
-TUXBOX_APPS_LIB_PKGCONFIG(SIGC,sigc++-1.2)
-TUXBOX_APPS_LIB_PKGCONFIG(DVBSI,libdvbsi++)
-_TUXBOX_APPS_LIB_PKGCONFIG_OPTIONAL(GSTREAMER,gstreamer,HAVE_GSTREAMER)
-_TUXBOX_APPS_LIB_PKGCONFIG_OPTIONAL(GSTREAMERPBUTILS,gstreamer-pbutils,HAVE_GSTSTREAMERPBUTILS)
-_TUXBOX_APPS_LIB_PKGCONFIG_OPTIONAL(LIBXINE,libxine,HAVE_LIBXINE)
-AC_CHECK_LIB(jpeg, jpeg_set_defaults, HAVE_JPEG="yes", HAVE_JPEG="no")
-JPEG_LIBS="-ljpeg"
-AC_SUBST(JPEG_LIBS)
-
-AC_SUBST(LIBUNGIF_LIBS,"")
-AC_CHECK_HEADERS(gif_lib.h,
-       AC_CHECK_LIB(ungif,DGifOpen,
-       [AC_DEFINE(HAVE_LIBUNGIF,1,[Define if you have libgif/libungif including devel headers])
-               LIBUNGIF_LIBS="-lungif"],
-               [AC_CHECK_LIB(gif,DGifOpen,
-                       [AC_DEFINE(HAVE_LIUNBGIF,1)
-                       LIBUNGIF_LIBS="-lgif"])]))
-
-TUXBOX_APPS_LIB_PKGCONFIG(XML2,libxml-2.0)
-
-# ok, we are in trouble: XMLCCWRAP only defines C++ symbols. So let's just check if linking works,
-# and assume everything will be ok. Then just check for the "exit" symbol, which should be always there.
-AC_LANG_SAVE
-AC_LANG_CPLUSPLUS
-TUXBOX_APPS_LIB_SYMBOL(XMLCCWRAP, xmlccwrap, exit)
-AC_LANG_RESTORE
-
-if test "$withsdl" = "yes" ; then
-       _TUXBOX_APPS_LIB_PKGCONFIG_OPTIONAL(SDL,sdl,WITH_SDL)
-       if test "$WITH_SDL" = "no" ; then
-               TUXBOX_APPS_LIB_CONFIG(SDL,sdl-config)
-               AC_DEFINE_UNQUOTED([WITH_SDL],[$withsdl],[With SDL])
+
+AC_ARG_WITH(po,
+       AS_HELP_STRING([--with-po],[enable updating of po files]),
+       [with_po="$withval"],[with_po="no"])
+if test "$with_po" = "yes"; then
+       AC_PATH_PROG(MSGINIT, msginit)
+       AC_PATH_PROG(MSGMERGE, msgmerge)
+       AC_PATH_PROG(MSGUNIQ, msguniq)
+       AC_PATH_PROG(XGETTEXT, xgettext)
+       if test -z "$MSGINIT" -o -z "$MSGMERGE" -o -z "$MSGUNIQ" -o -z "$XGETTEXT"; then
+               AC_MSG_ERROR([Could not find required gettext tools])
        fi
 fi
-# allow 'if WITH_SDL' conditionals in Makefile.am
-AM_CONDITIONAL(WITH_SDL, test "$WITH_SDL" = "yes")
+AM_CONDITIONAL(UPDATE_PO, test "$with_po" = "yes")
 
-CPPFLAGS="$CPPFLAGS "'-I$(top_srcdir)'
-CPPFLAGS="$CPPFLAGS -D_REENTRANT $PYTHON_CPPFLAGS $MD5SUM_CFLAGS $FREETYPE_CFLAGS $FRIBIDI_CFLAGS $ID3TAG_CFLAGS $MAD_CFLAGS $PLUGINS_CFLAGS $PNG_CFLAGS $SDL_CFLAGS $SIGC_CFLAGS $XMLTREE_CFLAGS $DVBSI_CFLAGS $GSTREAMER_CFLAGS $GSTREAMERPBUTILS_CFLAGS $LIBXINE_CFLAGS $LIBUNGIF_CFLAGS"
-#CPPFLAGS="$CPPFLAGS -DMEMLEAK_CHECK"
-CXXFLAGS="$CXXFLAGS -fno-rtti -fno-exceptions -Wall"
-LDFLAGS="$LDFLAGS -pthread $PYTHON_LDFLAGS $SDL_LDFLAGS $GSTREAMER_LDFLAGS $GSTREAMERPBUTILS_LDFLAGS $LIBXINE_LDFLAGS $LIBUNGIF_LDFLAGS"
-#LDFLAGS="-rdynamic $LDFLAGS"
+ENIGMA2_CFLAGS="-fno-rtti -fno-exceptions"
+AC_SUBST(ENIGMA2_CFLAGS)
 
-TUXBOX_APPS_GETTEXT
+CPPFLAGS="$CPPFLAGS $PYTHON_CPPFLAGS"
+CFLAGS="$CFLAGS $DEBUG_CFLAGS -Wall"
+CXXFLAGS="$CXXFLAGS $DEBUG_CFLAGS -Wall $BASE_CFLAGS $ENIGMA2_CFLAGS $PTHREAD_CFLAGS"
 
-AC_OUTPUT([
+AC_CONFIG_FILES([
 Makefile
 data/Makefile
 data/fonts/Makefile
@@ -93,6 +109,7 @@ data/defaults/Dream/Makefile
 data/defaults/Dream/hdbouquets/Makefile
 data/defaults/Dream/sdbouquets/Makefile
 data/extensions/Makefile
+data/keymaps/Makefile
 data/skin_default/Makefile
 data/skin_default/menu/Makefile
 data/skin_default/icons/Makefile
@@ -102,6 +119,7 @@ include/Makefile
 lib/Makefile
 lib/actions/Makefile
 lib/base/Makefile
+lib/base/eenv.cpp
 lib/driver/Makefile
 lib/dvb/Makefile
 lib/dvb/lowlevel/Makefile
@@ -188,8 +206,7 @@ lib/components/Makefile
 po/Makefile
 main/Makefile
 tools/Makefile
+tools/enigma2.sh
 enigma2.pc
 ])
-
-#lib/python/Plugins/Extensions/SimpleRSS/Makefile
-#lib/python/Plugins/Extensions/FileManager/Makefile
+AC_OUTPUT
index 1ed9444..0eaa082 100644 (file)
@@ -1,4 +1,4 @@
-SUBDIRS = countries fonts defaults extensions skin_default
+SUBDIRS = countries fonts defaults extensions keymaps skin_default
 
 dist_pkgdata_DATA = \
        defaultsatlists.xml \
index 1758f67..ee66c93 100644 (file)
@@ -15,4 +15,6 @@ dist_install_DATA = \
        settings.7020hd \
        settings.7025 \
        settings.800 \
-       settings.8000
+       settings.8000 \
+       settings.c \
+       settings.t
index b1b4d53..29d14b6 100644 (file)
                                <satellite type="192" />
                        </prerequisites>
                </file-->
-               <file type="favourites" directory="" name="bouquets.tv" />              
-               <file type="favourites" directory="hdbouquets/" name="userbouquet.favourites.tv" />
+               <file type="favourites" directory="" name="bouquets.tv">
+                       <prerequisites>
+                               <bcastsystem type="DVB-S" />
+                               <!--satellite type="192" /-->
+                       </prerequisites>
+               </file>
+               <file type="favourites" directory="hdbouquets/" name="userbouquet.favourites.tv">
+                       <prerequisites>
+                               <bcastsystem type="DVB-S" />
+                               <!--satellite type="192" /-->
+                       </prerequisites>
+               </file>
+               <file type="config" name="settings.c">
+                       <prerequisites>
+                               <bcastsystem type="DVB-C" />
+                       </prerequisites>
+               </file>
+               <file type="config" name="settings.t">
+                       <prerequisites>
+                               <bcastsystem type="DVB-T" />
+                       </prerequisites>
+               </file>
                <!--file type="package" directory="packages/" name="small-test_1.0_mipsel.ipk" /-->
        </files>
 </default>
index 3af4679..e0a1fbb 100644 (file)
                                <satellite type="192" />
                        </prerequisites>
                </file-->
-               <file type="favourites" directory="" name="bouquets.tv" />              
-               <file type="favourites" directory="hdbouquets/" name="userbouquet.favourites.tv" />
+               <file type="favourites" directory="" name="bouquets.tv">
+                       <prerequisites>
+                               <bcastsystem type="DVB-S" />
+                               <!--satellite type="192" /-->
+                       </prerequisites>
+               </file>
+               <file type="favourites" directory="hdbouquets/" name="userbouquet.favourites.tv">
+                       <prerequisites>
+                               <bcastsystem type="DVB-S" />
+                               <!--satellite type="192" /-->
+                       </prerequisites>
+               </file>
+               <file type="config" name="settings.c">
+                       <prerequisites>
+                               <bcastsystem type="DVB-C" />
+                       </prerequisites>
+               </file>
+               <file type="config" name="settings.t">
+                       <prerequisites>
+                               <bcastsystem type="DVB-T" />
+                       </prerequisites>
+               </file>
                <!--file type="package" directory="packages/" name="small-test_1.0_mipsel.ipk" /-->
        </files>
 </default>
index a1585cf..0211199 100644 (file)
                                <satellite type="192" />
                        </prerequisites>
                </file-->
-               <file type="favourites" directory="" name="bouquets.tv" />              
-               <file type="favourites" directory="sdbouquets/" name="userbouquet.favourites.tv" />
+               <file type="favourites" directory="" name="bouquets.tv">
+                       <prerequisites>
+                               <bcastsystem type="DVB-S" />
+                               <!--satellite type="192" /-->
+                       </prerequisites>
+               </file>
+               <file type="favourites" directory="sdbouquets/" name="userbouquet.favourites.tv">
+                       <prerequisites>
+                               <bcastsystem type="DVB-S" />
+                               <!--satellite type="192" /-->
+                       </prerequisites>
+               </file>
+               <file type="config" name="settings.c">
+                       <prerequisites>
+                               <bcastsystem type="DVB-C" />
+                       </prerequisites>
+               </file>
+               <file type="config" name="settings.t">
+                       <prerequisites>
+                               <bcastsystem type="DVB-T" />
+                       </prerequisites>
+               </file>
                <!--file type="package" directory="packages/" name="small-test_1.0_mipsel.ipk" /-->
        </files>
 </default>
index 4793bd8..39b0cb0 100644 (file)
                                <satellite type="192" />
                        </prerequisites>
                </file-->
-               <file type="favourites" directory="" name="bouquets.tv" />              
-               <file type="favourites" directory="hdbouquets/" name="userbouquet.favourites.tv" />
+               <file type="favourites" directory="" name="bouquets.tv">
+                       <prerequisites>
+                               <bcastsystem type="DVB-S" />
+                               <!--satellite type="192" /-->
+                       </prerequisites>
+               </file>
+               <file type="favourites" directory="hdbouquets/" name="userbouquet.favourites.tv">
+                       <prerequisites>
+                               <bcastsystem type="DVB-S" />
+                               <!--satellite type="192" /-->
+                       </prerequisites>
+               </file>
+               <file type="config" name="settings.c">
+                       <prerequisites>
+                               <bcastsystem type="DVB-C" />
+                       </prerequisites>
+               </file>
+               <file type="config" name="settings.t">
+                       <prerequisites>
+                               <bcastsystem type="DVB-T" />
+                       </prerequisites>
+               </file>
                <!--file type="package" directory="packages/" name="small-test_1.0_mipsel.ipk" /-->
        </files>
 </default>
index 2ef2013..f052226 100644 (file)
                                <satellite type="192" />
                        </prerequisites>
                </file-->
-               <file type="favourites" directory="" name="bouquets.tv" />              
-               <file type="favourites" directory="hdbouquets/" name="userbouquet.favourites.tv" />
+               <file type="favourites" directory="" name="bouquets.tv">
+                       <prerequisites>
+                               <bcastsystem type="DVB-S" />
+                               <!--satellite type="192" /-->
+                       </prerequisites>
+               </file>
+               <file type="favourites" directory="hdbouquets/" name="userbouquet.favourites.tv">
+                       <prerequisites>
+                               <bcastsystem type="DVB-S" />
+                               <!--satellite type="192" /-->
+                       </prerequisites>
+               </file>
+               <file type="config" name="settings.c">
+                       <prerequisites>
+                               <bcastsystem type="DVB-C" />
+                       </prerequisites>
+               </file>
+               <file type="config" name="settings.t">
+                       <prerequisites>
+                               <bcastsystem type="DVB-T" />
+                       </prerequisites>
+               </file>
                <!--file type="package" directory="packages/" name="small-test_1.0_mipsel.ipk" /-->
        </files>
 </default>
index 6974b12..1685ede 100644 (file)
                                <satellite type="192" />
                        </prerequisites>
                </file-->
-               <file type="favourites" directory="" name="bouquets.tv" />              
-               <file type="favourites" directory="hdbouquets/" name="userbouquet.favourites.tv" />
+               <file type="favourites" directory="" name="bouquets.tv">
+                       <prerequisites>
+                               <bcastsystem type="DVB-S" />
+                               <!--satellite type="192" /-->
+                       </prerequisites>
+               </file>
+               <file type="favourites" directory="hdbouquets/" name="userbouquet.favourites.tv">
+                       <prerequisites>
+                               <bcastsystem type="DVB-S" />
+                               <!--satellite type="192" /-->
+                       </prerequisites>
+               </file>
+               <file type="config" name="settings.c">
+                       <prerequisites>
+                               <bcastsystem type="DVB-C" />
+                       </prerequisites>
+               </file>
+               <file type="config" name="settings.t">
+                       <prerequisites>
+                               <bcastsystem type="DVB-T" />
+                       </prerequisites>
+               </file>
                <!--file type="package" directory="packages/" name="small-test_1.0_mipsel.ipk" /-->
        </files>
 </default>
diff --git a/data/defaults/Dream/settings.c b/data/defaults/Dream/settings.c
new file mode 100644 (file)
index 0000000..72ab938
--- /dev/null
@@ -0,0 +1 @@
+config.tv.lastroot=1:7:1:0:0:0:0:0:0:0:(type == 1) || (type == 17) || (type == 22) || (type == 25) || (type == 134) || (type == 195) ORDER BY name;
diff --git a/data/defaults/Dream/settings.t b/data/defaults/Dream/settings.t
new file mode 100644 (file)
index 0000000..72ab938
--- /dev/null
@@ -0,0 +1 @@
+config.tv.lastroot=1:7:1:0:0:0:0:0:0:0:(type == 1) || (type == 17) || (type == 22) || (type == 25) || (type == 134) || (type == 195) ORDER BY name;
index 132b427..ff0ae8b 100644 (file)
@@ -12,11 +12,14 @@ self.condition = self.runWizard
 self.disableKeys = True
                </code>
        </step>
-       <step id="nopackages" nextstep="finisheddefaultsatlists">
+
+       <!--step id="nopackages" nextstep="finisheddefaultsatlists"-->
+       <step id="nopackages" nextstep="scanquestion">
                <text value="There are no default services lists in your image." />
        </step>
        
-       <step id="nothingtoinstall" nextstep="finisheddefaultsatlists">
+       <!--step id="nothingtoinstall" nextstep="finisheddefaultsatlists"-->
+       <step id="nothingtoinstall" nextstep="scanquestion">
                <condition>
 if self.runWizard:
        self.condition = True
index f743b8c..2f7e7c7 100644 (file)
@@ -1,7 +1,8 @@
-installdir = $(FONTDIR)
+installdir = $(datadir)/fonts
 
 dist_install_DATA = \
        ae_AlMateen.ttf \
        lcd.ttf \
        md_khmurabi_10.ttf \
-       nmsbd.ttf
+       nmsbd.ttf \
+       tuxtxt.ttf
diff --git a/data/fonts/tuxtxt.ttf b/data/fonts/tuxtxt.ttf
new file mode 100644 (file)
index 0000000..9be6547
Binary files /dev/null and b/data/fonts/tuxtxt.ttf differ
diff --git a/data/keymaps/Makefile.am b/data/keymaps/Makefile.am
new file mode 100644 (file)
index 0000000..8499d99
--- /dev/null
@@ -0,0 +1,6 @@
+keymapsdir = $(datadir)/keymaps
+keymaps_DATA = \
+       dream-de.info \
+       dream-de.kmap \
+       eng.info \
+       eng.kmap
diff --git a/data/keymaps/dream-de.info b/data/keymaps/dream-de.info
new file mode 100644 (file)
index 0000000..d7f5b07
--- /dev/null
@@ -0,0 +1,2 @@
+kmap=dream-de.kmap
+name=Dreambox Keyboard Deutsch
diff --git a/data/keymaps/dream-de.kmap b/data/keymaps/dream-de.kmap
new file mode 100644 (file)
index 0000000..693317a
Binary files /dev/null and b/data/keymaps/dream-de.kmap differ
diff --git a/data/keymaps/eng.info b/data/keymaps/eng.info
new file mode 100644 (file)
index 0000000..d73372c
--- /dev/null
@@ -0,0 +1,2 @@
+kmap=eng.kmap
+name=Keyboard English
diff --git a/data/keymaps/eng.kmap b/data/keymaps/eng.kmap
new file mode 100644 (file)
index 0000000..15a722f
Binary files /dev/null and b/data/keymaps/eng.kmap differ
index f5dea73..c5eb07f 100755 (executable)
                        <item level="2" text="Fast Forward speeds">config.seek.speeds_forward</item>
                        <item level="2" text="Rewind speeds">config.seek.speeds_backward</item>
                        <item level="2" text="Slow Motion speeds">config.seek.speeds_slowmotion</item>
-<!-- TRANSLATORS: Note that "Enter" in the two strings below should *not*
-     be interpreted as "Give speed as input". The intended meaning is
-     instead "Initial speed when starting winding", i.e. the speed at
-     which "winding mode" is entered when first pressing "rewind" or
-     "fast forward". -->  
-                       <item level="2" text="Enter Fast Forward at speed">config.seek.enter_forward</item>
-                       <item level="2" text="Enter Rewind at speed">config.seek.enter_backward</item>
-<!-- TRANSLATORS: The effect of "Non-smooth winding" is that rather
-     than using ordinary "continuous" or "smooth" winding, a fast
-     sequence of stills is shown when winding at high speeds. This
-     makes it much easier too follow when almost each frame comes from
-     a new scene. The effect is achieved by repeating each shown frame
-     a couple of times. The settings control both at which speed this
-     winding mode sets in, and how many times each frame should be
-     repeated. This was previously called "Discontinuous playback"
-     which was incomprehensible. "Non-smooth winding" may be a better
-     term, but note that there is nothing irregular about it. Synonyms
-     better suited for translation to other languages may be "stepwise
-     winding/playback", or "winding/playback using stills". -->
-                       <item level="2" text="Use non-smooth winding at speeds above">config.seek.stepwise_minspeed</item>
-                       <item level="2" text="Frame repeat count during non-smooth winding">config.seek.stepwise_repeat</item>
+<!-- TRANSLATORS: The following is the speed you get on the first press on fast-forward.
+     It was previously called "enter fast forward at speed" which was easily misunderstood. -->  
+                       <item level="2" text="Initial Fast Forward speed">config.seek.enter_forward</item>
+                       <item level="2" text="Initial Rewind speed">config.seek.enter_backward</item>
                        <item level="2" text="Behavior of 'pause' when paused">config.seek.on_pause</item>
                        <item level="2" text="Behavior of 0 key in PiP-mode">config.usage.pip_zero_button</item>
                        <item level="2" text="Alternative services tuner priority">config.usage.alternatives_priority</item>
index 272fdcf..376a4fd 100755 (executable)
@@ -29,6 +29,9 @@
                <color name="WindowTitleForeground" color="#ffffff" />
                <color name="WindowTitleBackground" color="#000000" />
        </windowstyle>
+       <fonts>
+               <font filename="nmsbd.ttf" name="Display" scale="90"/>
+       </fonts>
        <!-- Screwed Stone II skin (skin_default.xml) /Nemesis -->
        <!-- About screen -->
        <screen name="About" position="center,center" size="420,350" title="About">
@@ -1166,75 +1169,75 @@ self.instance.move(ePoint(orgpos.x() + (orgwidth - newwidth)/2, orgpos.y()))
 
        <!-- LCD screen (channelselection) -->
        <screen name="ChannelSelection_summary" position="0,0" size="132,64" id="1">
-               <widget source="parent.ServiceEvent" render="Label" position="6,0" size="120,25" font="Regular;14" halign="center" valign="center" >
+               <widget source="parent.ServiceEvent" render="Label" position="6,0" size="120,25" font="Display;14" halign="center" valign="center" >
                        <convert type="ServiceName">Name</convert>
                </widget>
                <widget source="parent.ServiceEvent" render="Progress" position="16,27" size="100,5" borderWidth="1">
                        <convert type="EventTime">Progress</convert>
                </widget>
-               <widget source="global.CurrentTime" render="Label" position="6,32" size="90,32" font="Regular;32" halign="right" valign="top">
+               <widget source="global.CurrentTime" render="Label" position="6,32" size="90,32" font="Display;32" halign="right" valign="top">
                        <convert type="ClockToText">Format:%H:%M</convert>
                </widget>
-               <widget source="global.CurrentTime" render="Label" position="100,34" zPosition="1" size="26,30" font="Regular;16" valign="top">
+               <widget source="global.CurrentTime" render="Label" position="100,34" zPosition="1" size="26,30" font="Display;16" valign="top">
                        <convert type="ClockToText">Format:%S</convert>
                </widget>
        </screen> 
        <!-- Color OLED screen (ChannelSelection) -->
        <screen name="ChannelSelection_summary" position="0,0" size="96,64" id="2">
-               <widget source="parent.ServiceEvent" render="Label" position="0,0" size="96,28" font="Regular;16" halign="center" valign="center" >
+               <widget source="parent.ServiceEvent" render="Label" position="0,0" size="96,28" font="Display;16" halign="center" valign="center" >
                        <convert type="ServiceName">Name</convert>
                </widget>
                <widget source="session.Event_Now" render="Progress" position="0,30" size="96,8" borderWidth="1" backgroundColor="dark">
                        <convert type="EventTime">Progress</convert>
                </widget>
-               <widget source="global.CurrentTime" render="Label" position="0,38" size="96,26" font="Regular;32" halign="center" valign="center" foregroundColor="#FFFFFF" backgroundColor="#000000" >
+               <widget source="global.CurrentTime" render="Label" position="0,38" size="96,26" font="Display;32" halign="center" valign="center" foregroundColor="#FFFFFF" backgroundColor="#000000" >
                        <convert type="ClockToText">Format:%H:%M</convert>
                </widget>
        </screen>
        <!-- LCD screen (main) -->
        <screen name="InfoBarSummary" position="0,0" size="132,64" id="1">
-               <widget source="session.CurrentService" render="Label" position="6,0" size="120,25" font="Regular;14" halign="center" valign="center" >
+               <widget source="session.CurrentService" render="Label" position="6,0" size="120,25" font="Display;14" halign="center" valign="center" >
                        <convert type="ServiceName">Name</convert>
                </widget>
                <widget source="session.Event_Now" render="Progress" position="16,27" size="100,5" borderWidth="1">
                        <convert type="EventTime">Progress</convert>
                </widget>
-               <widget source="global.CurrentTime" render="Label" position="6,32" size="90,32" font="Regular;32" halign="right" valign="top">
+               <widget source="global.CurrentTime" render="Label" position="6,32" size="90,32" font="Display;32" halign="right" valign="top">
                        <convert type="ClockToText">Format:%H:%M</convert>
                </widget>
-               <widget source="global.CurrentTime" render="Label" position="100,34" zPosition="1" size="26,30" font="Regular;16" valign="top">
+               <widget source="global.CurrentTime" render="Label" position="100,34" zPosition="1" size="26,30" font="Display;16" valign="top">
                        <convert type="ClockToText">Format:%S</convert>
                </widget>
-               <widget source="session.RecordState" render="FixedLabel" text=" " position="6,30" zPosition="1" size="120,34">
+               <widget source="session.RecordState" render="FixedLabel" text=" " position="6,32" zPosition="1" size="126,32">
                        <convert type="ConfigEntryTest">config.usage.blinking_display_clock_during_recording,True,CheckSourceBoolean</convert>
                        <convert type="ConditionalShowHide">Blink</convert>
                </widget>
        </screen>
        <!-- Color OLED screen (main) -->
        <screen name="InfoBarSummary" position="0,0" size="96,64" id="2">
-               <widget source="session.CurrentService" render="Label" position="0,0" size="96,28" font="Regular;16" halign="center" valign="center" >
+               <widget source="session.CurrentService" render="Label" position="0,0" size="96,28" font="Display;16" halign="center" valign="center" >
                        <convert type="ServiceName">Name</convert>
                </widget>
                <widget source="session.Event_Now" render="Progress" position="0,30" size="96,8" borderWidth="1" backgroundColor="dark">
                        <convert type="EventTime">Progress</convert>
                </widget>
-               <widget source="global.CurrentTime" render="Label" position="0,38" size="96,26" font="Regular;32" halign="center" valign="center" foregroundColor="#FFFFFF" backgroundColor="#000000" >
+               <widget source="global.CurrentTime" render="Label" position="0,38" size="96,26" font="Display;32" halign="center" valign="center" foregroundColor="#FFFFFF" backgroundColor="#000000" >
                        <convert type="ClockToText">Format:%H:%M</convert>
                </widget>
-               <widget source="session.RecordState" render="FixedLabel" text=" " position="0,38" zPosition="1" size="96,30">
+               <widget source="session.RecordState" render="FixedLabel" text=" " position="0,38" zPosition="1" size="96,26">
                        <convert type="ConfigEntryTest">config.usage.blinking_display_clock_during_recording,True,CheckSourceBoolean</convert>
                        <convert type="ConditionalShowHide">Blink</convert>
                </widget>
        </screen>
        <!-- LCD screen (movieplayer) -->
        <screen name="InfoBarMoviePlayerSummary" position="0,0" size="132,64" id="1">
-               <widget source="session.CurrentService" render="Label" position="6,0" size="120,25" font="Regular;14" halign="center" valign="center" >
+               <widget source="session.CurrentService" render="Label" position="6,0" size="120,25" font="Display;14" halign="center" valign="center" >
                        <convert type="ServiceName">Name</convert>
                </widget>
                <widget source="session.CurrentService" render="Progress" position="16,27" size="100,5" borderWidth="1">
                        <convert type="ServicePosition">Position</convert>
                </widget>
-               <widget source="global.CurrentTime" render="Label" position="6,32" size="120,32" font="Regular;32" halign="center" valign="center">
+               <widget source="global.CurrentTime" render="Label" position="6,32" size="120,32" font="Display;32" halign="center" valign="center">
                        <convert type="ClockToText">Format:%H:%M</convert>
                </widget>
                <widget source="session.RecordState" render="FixedLabel" text=" " position="6,32" zPosition="1" size="120,32">
@@ -1244,87 +1247,87 @@ self.instance.move(ePoint(orgpos.x() + (orgwidth - newwidth)/2, orgpos.y()))
        </screen>
        <!-- Color OLED screen (movieplayer) -->
        <screen name="InfoBarMoviePlayerSummary" position="0,0" size="96,64" id="2">
-               <widget source="session.CurrentService" render="Label" position="0,0" size="96,28" font="Regular;16" halign="center" valign="center" >
+               <widget source="session.CurrentService" render="Label" position="0,0" size="96,28" font="Display;16" halign="center" valign="center" >
                        <convert type="ServiceName">Name</convert>
                </widget>
                <widget source="session.Event_Now" render="Progress" position="0,30" size="96,8" borderWidth="1" backgroundColor="dark">
                        <convert type="EventTime">Progress</convert>
                </widget>
-               <widget source="global.CurrentTime" render="Label" position="0,38" size="96,26" font="Regular;32" halign="center" valign="center" foregroundColor="#FFFFFF" backgroundColor="#000000" >
+               <widget source="global.CurrentTime" render="Label" position="0,38" size="96,26" font="Display;32" halign="center" valign="center" foregroundColor="#FFFFFF" backgroundColor="#000000" >
                        <convert type="ClockToText">Format:%H:%M</convert>
                </widget>
-               <widget source="session.RecordState" render="FixedLabel" text=" " position="0,38" zPosition="1" size="96,30">
+               <widget source="session.RecordState" render="FixedLabel" text=" " position="0,38" zPosition="1" size="96,26">
                        <convert type="ConfigEntryTest">config.usage.blinking_display_clock_during_recording,True,CheckSourceBoolean</convert>
                        <convert type="ConditionalShowHide">Blink</convert>
                </widget>
        </screen>
        <!-- LCD screen (ChoiceBox) -->
        <screen name="ChoiceBox_summary" position="0,0" size="132,64" id="1">
-               <widget source="parent.summary_list" render="Label" position="6,0" size="126,64" font="Regular;11" />
+               <widget source="parent.summary_list" render="Label" position="6,0" size="126,64" font="Display;11" />
        </screen>
        <!-- Color OLED screen (ChoiceBox) -->
        <screen name="ChoiceBox_summary" position="0,0" size="96,64" id="2">
-               <widget source="parent.summary_list" render="Label" position="0,0" size="96,64" font="Regular;10" />
+               <widget source="parent.summary_list" render="Label" position="0,0" size="96,64" font="Display;10" />
        </screen>       
        <!-- LCD screen (MessageBox) -->
        <screen name="MessageBox_summary" position="0,0" size="132,64" id="1">
-               <widget source="parent.Text" render="Label" position="0,0" size="132,52" font="Regular;11" halign="center" valign="center" />
-               <widget source="parent.selectedChoice" render="Label" position="6,50" size="120,14" font="Regular;14" halign="center" valign="center" />
+               <widget source="parent.Text" render="Label" position="0,0" size="132,52" font="Display;11" halign="center" valign="center" />
+               <widget source="parent.selectedChoice" render="Label" position="6,50" size="120,14" font="Display;14" halign="center" valign="center" />
        </screen>
        <!-- Color OLED screen (MessageBox) -->
        <screen name="MessageBox_summary" position="0,0" size="96,64" id="2">
-               <widget source="parent.Text" render="Label" position="0,0" size="96,52" font="Regular;10" halign="center" valign="center" />
-               <widget source="parent.selectedChoice" render="Label" position="0,50" size="96,14" font="Regular;12" halign="center" valign="center" />
+               <widget source="parent.Text" render="Label" position="0,0" size="96,52" font="Display;10" halign="center" valign="center" />
+               <widget source="parent.selectedChoice" render="Label" position="0,50" size="96,14" font="Display;12" halign="center" valign="center" />
        </screen>
        <!-- LCD screen (menus) -->
        <screen name="MenuSummary" position="0,0" size="132,64" id="1">
-               <widget source="parent.title" render="Label" position="6,0" size="120,32" font="Regular;14" halign="center" valign="center"/>
-               <widget source="parent.menu" render="Label" position="6,32" size="120,32" font="Regular;16" halign="center" valign="center">
+               <widget source="parent.title" render="Label" position="6,0" size="120,32" font="Display;14" halign="center" valign="center"/>
+               <widget source="parent.menu" render="Label" position="6,32" size="120,32" font="Display;16" halign="center" valign="center">
                        <convert type="StringListSelection" />
                </widget>
        </screen> 
        <!-- Color OLED screen (menus) -->
        <screen name="MenuSummary" position="0,0" size="96,64" id="2">
-               <widget source="parent.title" render="Label" position="0,0" size="96,32" font="Regular;15" halign="center" valign="center"/>
-               <widget source="parent.menu" render="Label" position="0,32" size="96,32" font="Regular;16" halign="center" valign="top">
+               <widget source="parent.title" render="Label" position="0,0" size="96,32" font="Display;15" halign="center" valign="center"/>
+               <widget source="parent.menu" render="Label" position="0,32" size="96,32" font="Display;16" halign="center" valign="top">
                        <convert type="StringListSelection" />
                </widget>
        </screen>       
        <!-- LCD screen (ServiceScan) -->
        <screen name="ServiceScanSummary" position="0,0" size="132,64" id="1">
-               <widget name="Title" position="6,4" size="120,42" font="Regular;16" transparent="1" />
-               <widget name="Service" position="6,22" size="120,26" font="Regular;12" transparent="1" />
+               <widget name="Title" position="6,4" size="120,42" font="Display;16" transparent="1" />
+               <widget name="Service" position="6,22" size="120,26" font="Display;12" transparent="1" />
                <widget name="scan_progress" position="6,50" zPosition="1" borderWidth="1" size="56,12" backgroundColor="dark" />
        </screen>
        <!-- Color OLED screen (ServiceScan) -->
        <screen name="ServiceScanSummary" position="0,0" size="96,64" id="2">
-               <widget name="Title" position="0,0" size="96,30" font="Regular;14" transparent="1" />
-               <widget name="Service" position="0,30" size="96,20" font="Regular;10" transparent="1" />
+               <widget name="Title" position="0,0" size="96,30" font="Display;14" transparent="1" />
+               <widget name="Service" position="0,30" size="96,20" font="Display;10" transparent="1" />
                <widget name="scan_progress" position="0,50" zPosition="1" borderWidth="1" size="96,12" backgroundColor="dark" />
        </screen>
        <!-- LCD screen (setup) -->
        <screen name="SetupSummary" position="0,0" size="132,64" id="1">
-               <widget source="SetupTitle" render="Label" position="6,0" size="120,16" font="Regular;12" />
-               <widget source="SetupEntry" render="Label" position="6,16" size="120,32" font="Regular;12" />
-               <widget source="SetupValue" render="Label" position="6,48" size="120,16" font="Regular;12" />
+               <widget source="SetupTitle" render="Label" position="6,0" size="120,16" font="Display;12" />
+               <widget source="SetupEntry" render="Label" position="6,16" size="120,32" font="Display;12" />
+               <widget source="SetupValue" render="Label" position="6,48" size="120,16" font="Display;12" />
        </screen>
        <!-- Color OLED screen (setup) -->
        <screen name="SetupSummary" position="0,0" size="96,64" id="2">
-               <widget source="SetupTitle" render="Label" position="0,0" size="96,16" font="Regular;10" />
-               <widget source="SetupEntry" render="Label" position="0,16" size="96,32" font="Regular;10" />
-               <widget source="SetupValue" render="Label" position="0,48" size="96,16" font="Regular;10" />
+               <widget source="SetupTitle" render="Label" position="0,0" size="96,16" font="Display;10" />
+               <widget source="SetupEntry" render="Label" position="0,16" size="96,32" font="Display;10" />
+               <widget source="SetupValue" render="Label" position="0,48" size="96,16" font="Display;10" />
        </screen>
        <!-- LCD screen (misc) -->
        <screen name="SimpleSummary" position="0,0" size="132,64" id="1">
-               <widget source="parent.Title" render="Label" position="6,0" size="120,64" font="Regular;16" halign="center" valign="center" />
+               <widget source="parent.Title" render="Label" position="6,0" size="120,64" font="Display;16" halign="center" valign="center" />
        </screen>
        <!-- Color OLED screen (misc) -->
        <screen name="SimpleSummary" position="0,0" size="96,64" id="2">
-               <widget source="parent.Title" render="Label" position="0,0" size="96,64" font="Regular;14" halign="center" valign="center" />
+               <widget source="parent.Title" render="Label" position="0,0" size="96,64" font="Display;14" halign="center" valign="center" />
        </screen>
        <!-- LCD screen (standby) -->
        <screen name="StandbySummary" position="0,0" size="132,64" id="1">
-               <widget source="global.CurrentTime" render="Label" position="6,0" size="120,64" font="Regular;40" halign="center" valign="center">
+               <widget source="global.CurrentTime" render="Label" position="6,0" size="120,64" font="Display;40" halign="center" valign="center">
                        <convert type="ClockToText">Format:%H:%M</convert>
                </widget>
                <widget source="session.RecordState" render="FixedLabel" position="6,0" zPosition="1" size="120,64" text=" ">
@@ -1334,7 +1337,7 @@ self.instance.move(ePoint(orgpos.x() + (orgwidth - newwidth)/2, orgpos.y()))
        </screen>
        <!-- Color OLED screen (standby) -->
        <screen name="StandbySummary" position="0,0" size="96,64" id="2">
-               <widget source="global.CurrentTime" render="Label" position="0,0" size="96,64" font="Regular;38" halign="center" valign="center">
+               <widget source="global.CurrentTime" render="Label" position="0,0" size="96,64" font="Display;38" halign="center" valign="center">
                        <convert type="ClockToText">Format:%H:%M</convert>
                </widget>
                <widget source="session.RecordState" render="FixedLabel" position="0,0" zPosition="1" size="96,64" text=" ">
@@ -1344,33 +1347,33 @@ self.instance.move(ePoint(orgpos.x() + (orgwidth - newwidth)/2, orgpos.y()))
        </screen>
        <!-- LCD screen (JobView) -->
        <screen name="JobView_summary" position="0,0" size="132,64" id="1">
-               <widget source="parent.summary_job_name" render="Label" position="6,4" size="120,42" font="Regular;16" />
-               <widget source="parent.summary_job_task" render="Label" position="6,22" size="120,26" font="Regular;12" />
+               <widget source="parent.summary_job_name" render="Label" position="6,4" size="120,42" font="Display;16" />
+               <widget source="parent.summary_job_task" render="Label" position="6,22" size="120,26" font="Display;12" />
                <widget source="parent.summary_job_progress" render="Progress" position="6,50" size="60,12" borderWidth="1" zPosition="1" />
-               <widget source="parent.summary_job_progress" render="Label" position="66,50" size="50,12" font="Regular;12" zPosition="2" halign="center" transparent="1"  >
+               <widget source="parent.summary_job_progress" render="Label" position="66,50" size="50,12" font="Display;12" zPosition="2" halign="center" transparent="1"  >
                        <convert type="ProgressToText" />
                </widget>
        </screen>
        <!-- Color OLED screen (JobView) -->
        <screen name="JobView_summary" position="0,0" size="96,64" id="2">
-               <widget source="parent.summary_job_name" render="Label" position="0,4" size="96,42" font="Regular;14" />
-               <widget source="parent.summary_job_task" render="Label" position="0,22" size="96,26" font="Regular;10" />
+               <widget source="parent.summary_job_name" render="Label" position="0,4" size="96,42" font="Display;14" />
+               <widget source="parent.summary_job_task" render="Label" position="0,22" size="96,26" font="Display;10" />
                <widget source="parent.summary_job_progress" render="Progress" position="0,50" size="60,12" borderWidth="1" zPosition="1" />
-               <widget source="parent.summary_job_progress" render="Label" position="60,50" size="36,12" font="Regular;10" zPosition="2" halign="center" transparent="1"  >
+               <widget source="parent.summary_job_progress" render="Label" position="60,50" size="36,12" font="Display;10" zPosition="2" halign="center" transparent="1"  >
                        <convert type="ProgressToText" />
                </widget>
        </screen>
        <!-- LCD screen (Wizard) -->
        <screen name="WizardSummary" position="0,0" size="132,64" id="1">
-               <widget source="text" render="Label" position="6,0" size="120,16" font="Regular;16" transparent="1" />
-               <widget source="parent.list" render="Label" position="6,18" size="120,46" font="Regular;12">
+               <widget source="text" render="Label" position="6,0" size="120,16" font="Display;16" transparent="1" />
+               <widget source="parent.list" render="Label" position="6,18" size="120,46" font="Display;12">
                        <convert type="StringListSelection" />
                </widget>
        </screen>
        <!-- Color OLED screen (Wizard) -->
        <screen name="WizardSummary" position="0,0" size="96,64" id="2">
-               <widget source="text" render="Label" position="0,0" size="96,16" font="Regular;14" transparent="1" />
-               <widget source="parent.list" render="Label" position="0,18" size="96,46" font="Regular;12">
+               <widget source="text" render="Label" position="0,0" size="96,16" font="Display;14" transparent="1" />
+               <widget source="parent.list" render="Label" position="0,18" size="96,46" font="Display;12">
                        <convert type="StringListSelection" />
                </widget>
        </screen>
index b453aa7..7a709b0 100755 (executable)
@@ -45,10 +45,10 @@ dist_install_DATA = \
        mp_buttons.png \
        network_wired.png \
        network_wired-active.png \
-       network_wired-inactive.png \    
+       network_wired-inactive.png \
        network_wireless.png \
        network_wireless-active.png \
-       network_wireless-inactive.png \ 
+       network_wireless-inactive.png \
        plugin.png \
        rass_logo.png \
        rass_page1.png \
diff --git a/debug b/debug
deleted file mode 100755 (executable)
index d247b3e..0000000
--- a/debug
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-
-/home/dump/tmb/oe-mono/build/tmp/work/gdb-cross-6.3-r0/install/gdb-cross/usr/local/mipsel/oe/bin/mipsel-linux-gdb main/enigma2 -x debug.gdb
-
diff --git a/debug.gdb b/debug.gdb
deleted file mode 100644 (file)
index 69cf5d0..0000000
--- a/debug.gdb
+++ /dev/null
@@ -1,3 +0,0 @@
-set solib-absolute-prefix /home/tmbinc/mips/target
-target remote 10.0.0.203:1234
-continue
diff --git a/enigma2.bb b/enigma2.bb
new file mode 100644 (file)
index 0000000..2da423c
--- /dev/null
@@ -0,0 +1,75 @@
+DESCRIPTION = "Enigma2 is an experimental, but useful framebuffer-based frontend for DVB functions"
+DESCRIPTION_append_enigma2-plugin-extensions-cutlisteditor = "enables you to cut your movies."
+DESCRIPTION_append_enigma2-plugin-extensions-graphmultiepg = "shows a graphical timeline EPG."
+DESCRIPTION_append_enigma2-plugin-extensions-pictureplayer = "displays photos on the TV."
+DESCRIPTION_append_enigma2-plugin-systemplugins-frontprocessorupdate = "keeps your frontprocessor up to date."
+DESCRIPTION_append_enigma2-plugin-systemplugins-positionersetup = "helps you installing a motorized dish."
+DESCRIPTION_append_enigma2-plugin-systemplugins-satelliteequipmentcontrol = "allows you to fine-tune DiSEqC-settings."
+DESCRIPTION_append_enigma2-plugin-systemplugins-satfinder = "helps you to align your dish."
+DESCRIPTION_append_enigma2-plugin-systemplugins-skinselector = "shows a menu with selectable skins."
+DESCRIPTION_append_enigma2-plugin-systemplugins-videomode = "selects advanced video modes"
+DESCRIPTION_append_enigma2-plugin-systemplugins-crashlogautosubmit = "automatically send crashlogs to Dream Multimedia"
+DESCRIPTION_append_enigma2-plugin-systemplugins-cleanupwizard = "informs you on low internal memory on system startup."
+DESCRIPTION_append_enigma2-plugin-extenstions-modem = "opens a menu to connect to internet via builtin modem."
+DESCRIPTION_append_enigma2-plugin-systemplugins-wirelesslan = "helps you configuring your wireless lan"
+DESCRIPTION_append_enigma2-plugin-systemplugins-networkwizard = "provides easy step by step network configuration"
+
+DEPENDS = "jpeg libungif libpng libsigc++-1.2 gettext-native \
+        dreambox-dvbincludes freetype libdvbsi++ python swig-native \
+        libfribidi libxmlccwrap libdreamdvd gstreamer gst-plugin-dvbmediasink \
+        gst-plugins-bad gst-plugins-good gst-plugins-ugly python-wifi"
+
+RDEPENDS = "python-codecs python-core python-lang python-re python-threading \
+        python-xml python-fcntl gst-plugin-decodebin gst-plugin-decodebin2 python-stringold \
+        python-pickle gst-plugin-app \
+        gst-plugin-id3demux gst-plugin-mad gst-plugin-ogg gst-plugin-playbin \
+        gst-plugin-typefindfunctions gst-plugin-audioconvert gst-plugin-audioresample \
+        gst-plugin-wavparse python-netclient gst-plugin-mpegstream gst-plugin-selector \
+        gst-plugin-flac gst-plugin-dvbmediasink gst-plugin-mpegdemux \
+        gst-plugin-souphttpsrc gst-plugin-mpegaudioparse gst-plugin-subparse \
+        gst-plugin-apetag gst-plugin-icydemux gst-plugin-autodetect \
+        glibc-gconv-iso8859-15 ethtool"
+
+GST_ALSA_RDEPENDS = "gst-plugin-alsa alsa-conf"
+GST_DVD_RDEPENDS = "gst-plugin-cdxaparse gst-plugin-cdio gst-plugin-vcdsrc"
+GST_MISC_RDEPENDS = "gst-plugin-matroska gst-plugin-qtdemux gst-plugin-vorbis gst-plugin-audioparsersbad"
+GST_RTSP_RDEPENDS = "gst-plugin-udp gst-plugin-rtsp gst-plugin-rtp gst-plugin-rtpmanager"
+GST_BASE_RDEPENDS = "${GST_ALSA_RDEPENDS} ${GST_MISC_RDEPENDS} ${GST_RTSP_RDEPENDS}"
+
+RDEPENDS_append_dm800 = " ${GST_BASE_RDEPENDS} gst-plugin-ivorbisdec"
+RDEPENDS_append_dm8000 = " ${GST_BASE_RDEPENDS} ${GST_DVD_RDEPENDS} gst-plugin-avi"
+RDEPENDS_append_dm500hd = " ${GST_BASE_RDEPENDS} ${GST_DVD_RDEPENDS} gst-plugin-avi"
+RDEPENDS_append_dm800se = " ${GST_BASE_RDEPENDS} ${GST_DVD_RDEPENDS} gst-plugin-avi"
+
+RDEPENDS_enigma2-plugin-extensions-cutlisteditor = "aio-grab"
+RDEPENDS_enigma2-plugin-extensions-dvdplayer = "libdreamdvd0"
+RDEPENDS_enigma2-plugin-systemplugins-nfiflash = "python-twisted-web"
+RDEPENDS_enigma2-plugin-systemplugins-softwaremanager = "python-twisted-web"
+RDEPENDS_enigma2-plugin-systemplugins-crashlogautosubmit = "twisted-mail twisted-names python-compression python-mime python-email"
+RDEPENDS_enigma2-plugin-extensions-modem = "dreambox-modem-ppp-scripts ppp"
+RDEPENDS_enigma2-plugin-systemplugins-wirelesslan = "wpa-supplicant wireless-tools python-wifi"
+
+RCONFLICTS_enigma2-plugin-systemplugins-softwaremanager = "enigma2-plugin-systemplugins-configurationbackup enigma2-plugin-systemplugins-softwareupdate"
+RREPLACES_enigma2-plugin-systemplugins-softwaremanager = "enigma2-plugin-systemplugins-configurationbackup enigma2-plugin-systemplugins-softwareupdate"
+
+PV = "${GITVER}"
+
+inherit srctree autotools gitver pkgconfig
+
+EXTRA_OECONF = " \
+        BUILD_SYS=${BUILD_SYS} \
+        HOST_SYS=${HOST_SYS} \
+        STAGING_INCDIR=${STAGING_INCDIR} \
+        STAGING_LIBDIR=${STAGING_LIBDIR} \
+"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+PACKAGES += "${PN}-meta"
+
+FILES_${PN} += "${datadir}/fonts"
+FILES_${PN}-meta = "${datadir}/meta"
+
+python populate_packages_prepend () {
+        enigma2_plugindir = bb.data.expand('${libdir}/enigma2/python/Plugins', d)
+        do_split_packages(d, enigma2_plugindir, '(.*?/.*?)/.*', 'enigma2-plugin-%s', '%s ', recursive=True, match_path=True, prepend=True)
+}
index 01ba434..f34d904 100644 (file)
@@ -6,5 +6,5 @@ includedir=@includedir@
 Name: enigma2
 Description: Enigma2
 Version: @VERSION@
-Libs: 
-Cflags: -I${includedir}/enigma2
+Cflags: -I${includedir}/enigma2 @ENIGMA2_CFLAGS@
+Requires.private: sigc++-1.2
index d0c682f..ada16ca 100644 (file)
@@ -1,3 +1,3 @@
-EXTRA_DIST = \
+pkginclude_HEADERS = \
        connection.h \
        libsig_comp.h
diff --git a/lib/actions/.gitignore b/lib/actions/.gitignore
new file mode 100644 (file)
index 0000000..460e43d
--- /dev/null
@@ -0,0 +1 @@
+actionids.h
index 8da583f..eb8327d 100644 (file)
@@ -1,15 +1,27 @@
-INCLUDES = \
-       -I$(top_srcdir)/include
+AM_CPPFLAGS = \
+       -I$(top_builddir) \
+       -I$(top_srcdir) \
+       -I$(top_srcdir)/include \
+       -include Python.h \
+       -include $(top_builddir)/enigma2_config.h
+
+EXTRA_DIST = parseactions.py
 
 noinst_LIBRARIES = libenigma_actions.a
 
 libenigma_actions_a_SOURCES = \
-       action.cpp 
+       action.cpp
 
-CLEANFILES = actionids.h
+actionsincludedir = $(pkgincludedir)/lib/actions
+actionsinclude_HEADERS = \
+       action.h
 
-action.cpp: actionids.h
+nodist_actionsinclude_HEADERS = \
+       actionids.h
+
+BUILT_SOURCES = actionids.h
+CLEANFILES = actionids.h
 
-actionids.h:
-        python ./parseactions.py include ../gui/*.h > actionids.h
-        python ./parseactions.py parse ../gui/*.h >> actionids.h
+actionids.h: $(srcdir)/parseactions.py $(top_srcdir)/lib/gui/*.h
+       $(AM_V_GEN)$(PYTHON) $(srcdir)/parseactions.py include $(top_srcdir)/lib/gui/*.h > $@
+       $(AM_V_at)$(PYTHON) $(srcdir)/parseactions.py parse $(top_srcdir)/lib/gui/*.h >> $@
index cbf5370..edcfac6 100644 (file)
@@ -3,10 +3,6 @@
 
 #include <lib/base/object.h>
 
-               /* avoid warnigs :) */
-#include <features.h>
-#undef _POSIX_C_SOURCE
-#define _POSIX_C_SOURCE 200112L
 #include <lib/python/python.h>
 #include <string>
 #include <map>
index 2462a75..cad432a 100644 (file)
@@ -89,7 +89,7 @@ def do_file(f, mode):
 
                                                if mode == "include":
                                                        # hack hack hack!!
-                                                       print "#include <lib" + f[2:] + ">"
+                                                       print "#include <lib/" + '/'.join(f.split('/')[-2:]) + ">"
                                                else:
                                                        print "\t// " + f
 
diff --git a/lib/base/.gitignore b/lib/base/.gitignore
new file mode 100644 (file)
index 0000000..aa9ae18
--- /dev/null
@@ -0,0 +1 @@
+eenv.cpp
index 0508563..d76dfc9 100644 (file)
@@ -1,12 +1,56 @@
-INCLUDES = \
-       -I$(top_srcdir)/include
+AM_CPPFLAGS = \
+       -I$(top_srcdir) \
+       -I$(top_srcdir)/include \
+       -include Python.h \
+       -include $(top_builddir)/enigma2_config.h
 
 noinst_LIBRARIES = libenigma_base.a
 
 libenigma_base_a_SOURCES = \
-       buffer.cpp ebase.cpp eerror.cpp elock.cpp \
-       init.cpp message.cpp thread.cpp \
-       smartptr.cpp estring.cpp connection.cpp \
-       filepush.cpp encoding.cpp console.cpp rawfile.cpp \
-       nconfig.cpp ioprio.cpp etpm.cpp
+       buffer.cpp \
+       connection.cpp \
+       console.cpp \
+       ebase.cpp \
+       eenv.cpp \
+       eerror.cpp \
+       elock.cpp \
+       encoding.cpp \
+       estring.cpp \
+       etpm.cpp \
+       filepush.cpp \
+       init.cpp \
+       ioprio.cpp \
+       message.cpp \
+       nconfig.cpp \
+       rawfile.cpp \
+       smartptr.cpp \
+       thread.cpp
 
+EXTRA_DIST = \
+       eenv.cpp.in
+
+baseincludedir = $(pkgincludedir)/lib/base
+baseinclude_HEADERS = \
+       buffer.h \
+       console.h \
+       ebase.h \
+       eenv.h \
+       eerror.h \
+       elock.h \
+       encoding.h \
+       eptrlist.h \
+       estring.h \
+       etpm.h \
+       filepush.h \
+       i18n.h \
+       itssource.h \
+       init.h \
+       init_num.h \
+       ioprio.h \
+       message.h \
+       nconfig.h \
+       object.h \
+       rawfile.h \
+       ringbuffer.h \
+       smartptr.h \
+       thread.h
index e730b40..60540da 100644 (file)
@@ -1,7 +1,6 @@
 #ifndef __LIB_BASE_CONSOLE_H__
 #define __LIB_BASE_CONSOLE_H__
 
-#include "Python.h"
 #include <string>
 #include <lib/base/ebase.h>
 #include <lib/python/connections.h>
diff --git a/lib/base/eenv.cpp.in b/lib/base/eenv.cpp.in
new file mode 100644 (file)
index 0000000..52c4214
--- /dev/null
@@ -0,0 +1,117 @@
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+#include <wordexp.h>
+#include <lib/base/eenv.h>
+#include <lib/base/eerror.h>
+
+bool eEnv::initialized = false;
+
+void eEnv::initialize()
+{
+       static const struct {
+               std::string name;
+               std::string value;
+       } cfgenv[] = {
+               { "prefix", "@prefix@" },
+               { "exec_prefix", "@exec_prefix@" },
+               { "bindir", "@bindir@" },
+               { "sbindir", "@sbindir@" },
+               { "libexecdir", "@libexecdir@" },
+               { "datarootdir", "@datarootdir@" },
+               { "datadir", "@datadir@" },
+               { "sysconfdir", "@sysconfdir@" },
+               { "sharedstatedir", "@sharedstatedir@" },
+               { "localstatedir", "@localstatedir@" },
+               { "libdir", "@libdir@" },
+               { "localedir", "@localedir@" },
+       };
+       size_t i;
+
+       // 1st pass, as generated by configure.
+       // Variables set by the user will not be overwritten.
+       for (i = 0; i < (sizeof(cfgenv) / sizeof(*cfgenv)); i++) {
+               eDebug("setenv('%s', '%s', 0)", cfgenv[i].name.c_str(), cfgenv[i].value.c_str());
+               setenv(cfgenv[i].name.c_str(), cfgenv[i].value.c_str(), 0);
+       }
+
+       // 2nd pass: Resolve directories.
+       for (i = 0; i < (sizeof(cfgenv) / sizeof(*cfgenv)); i++) {
+               std::string dest;
+               eEnv::resolveVar(dest, "${" + cfgenv[i].name + "}");
+               eDebug("setenv('%s', '%s', 1)", cfgenv[i].name.c_str(), dest.c_str());
+               setenv(cfgenv[i].name.c_str(), dest.c_str(), 1);
+       }
+}
+
+int eEnv::resolveVar(std::string &dest, const char *src)
+{
+       size_t i = 0;
+       int ret;
+       wordexp_t p;
+
+       ret = wordexp(src, &p, WRDE_NOCMD | WRDE_UNDEF);
+       if (ret != 0) {
+               switch (ret) {
+               case WRDE_BADCHAR:
+                       eDebug("%s: bad character", __func__);
+                       break;
+               case WRDE_BADVAL:
+                       eDebug("%s: bad value", __func__);
+                       break;
+               case WRDE_CMDSUB:
+                       eDebug("%s: invalid command substitution", __func__);
+                       break;
+               case WRDE_NOSPACE:
+                       eDebug("%s: out of memory", __func__);
+                       break;
+               case WRDE_SYNTAX:
+                       eDebug("%s: syntax error", __func__);
+                       break;
+               default:
+                       eDebug("%s: unknown error", __func__);
+                       break;
+               }
+
+               return -1;
+       }
+
+       while (i < p.we_wordc) {
+               if (strchr(p.we_wordv[i], '$')) {
+                       ret = eEnv::resolveVar(dest, p.we_wordv[i]);
+                       if (ret < 0)
+                               break;
+               } else {
+                       dest.append(p.we_wordv[i]);
+               }
+
+               if (++i < p.we_wordc)
+                       dest.append(" ");
+       }
+
+       wordfree(&p);
+       return ret;
+}
+
+int eEnv::resolveVar(std::string &dest, const std::string &src)
+{
+       return eEnv::resolveVar(dest, src.c_str());
+}
+
+std::string eEnv::resolve(const std::string &src)
+{
+       std::string dest;
+
+       if (!initialized) {
+               eEnv::initialize();
+               initialized = true;
+       }
+
+       eDebug("%s: resolve %s", __func__, src.c_str());
+
+       eEnv::resolveVar(dest, src);
+
+       eDebug("%s: -> %s", __func__, dest.c_str());
+
+       return dest;
+}
diff --git a/lib/base/eenv.h b/lib/base/eenv.h
new file mode 100644 (file)
index 0000000..3d149f5
--- /dev/null
@@ -0,0 +1,16 @@
+#ifndef __lib_base_paths_h
+#define __lib_base_paths_h
+
+#include <string>
+
+class eEnv {
+private:
+       static bool initialized;
+       static void initialize();
+       static int resolveVar(std::string &dest, const char *src);
+       static int resolveVar(std::string &dest, const std::string &src);
+public:
+       static std::string resolve(const std::string &path);
+};
+
+#endif
index 8b4b592..361acce 100644 (file)
@@ -2,6 +2,7 @@
 #include <cstdlib>
 #include <lib/base/encoding.h>
 #include <lib/base/eerror.h>
+#include <lib/base/eenv.h>
 
 eDVBTextEncodingHandler encodingHandler;  // the one and only instance
 
@@ -17,8 +18,8 @@ inline char toupper(char c)
 
 eDVBTextEncodingHandler::eDVBTextEncodingHandler()
 {
-       const char * file=DATADIR "/enigma2/encoding.conf";
-       FILE *f = fopen(file, "rt");
+       std::string file = eEnv::resolve("${datadir}/enigma2/encoding.conf");
+       FILE *f = fopen(file.c_str(), "rt");
        if (f)
        {
                char *line = (char*) malloc(256);
@@ -61,7 +62,7 @@ eDVBTextEncodingHandler::eDVBTextEncodingHandler()
                free(line);
        }
        else
-               eDebug("[eDVBTextEncodingHandler] couldn't open %s !", file);
+               eDebug("[eDVBTextEncodingHandler] couldn't open %s !", file.c_str());
 }
 
 void eDVBTextEncodingHandler::getTransponderDefaultMapping(int tsidonid, int &table)
index e377ab8..364c694 100644 (file)
@@ -1,6 +1,16 @@
-INCLUDES = \
-       -I$(top_srcdir)/include
+AM_CPPFLAGS = \
+       -I$(top_srcdir) \
+       -I$(top_srcdir)/include \
+       -include Python.h \
+       -include $(top_builddir)/enigma2_config.h
 
 noinst_LIBRARIES = libenigma_components.a
 
-libenigma_components_a_SOURCES = scan.cpp file_eraser.cpp
+libenigma_components_a_SOURCES = \
+       file_eraser.cpp \
+       scan.cpp
+
+componentsincludedir = $(pkgincludedir)/lib/components
+componentsinclude_HEADERS = \
+       file_eraser.h \
+       scan.h
index de1271b..b498a6c 100644 (file)
@@ -1,7 +1,38 @@
-INCLUDES = \
-       -I$(top_srcdir)/include
+AM_CPPFLAGS = \
+       -I$(top_srcdir) \
+       -I$(top_srcdir)/include \
+       -include Python.h \
+       -include $(top_builddir)/enigma2_config.h
+
+AM_CXXFLAGS = \
+       $(LIBSDL_CFLAGS)
 
 noinst_LIBRARIES = libenigma_driver.a
 
 libenigma_driver_a_SOURCES = \
-       rc.cpp rcinput.cpp rcconsole.cpp avswitch.cpp rfmod.cpp etimezone.cpp misc_options.cpp
+       avswitch.cpp \
+       etimezone.cpp \
+       misc_options.cpp \
+       rc.cpp \
+       rcconsole.cpp \
+       rcinput.cpp \
+       rfmod.cpp
+
+driverincludedir = $(pkgincludedir)/lib/driver
+driverinclude_HEADERS = \
+       avswitch.h \
+       etimezone.h \
+       input_fake.h \
+       misc_options.h \
+       rc.h \
+       rcconsole.h \
+       rcdbox.h \
+       rcdreambox2.h \
+       rcinput.h \
+       rfmod.h
+
+if HAVE_LIBSDL
+libenigma_driver_a_SOURCES += \
+       rcsdl.cpp \
+       rcsdl.h
+endif
index eb5aee3..97a6e7c 100644 (file)
@@ -5,7 +5,7 @@
 #include <stdio.h>
 #include <fcntl.h>
 
-eRCConsoleDriver::eRCConsoleDriver(const char *filename): eRCDriver(eRCInput::getInstance())
+eRCConsoleDriver::eRCConsoleDriver(const char *filename): eRCDriver(eRCInput::getInstance()), m_escape(false)
 {
        handle=open(filename, O_RDONLY|O_NONBLOCK);
        if (handle<0)
@@ -38,7 +38,7 @@ void eRCConsoleDriver::keyPressed(int)
        unsigned char data[16];
        unsigned char *d = data;
        int num = read(handle, data, 16);
-       int code=-1;
+       unsigned char code;
        
        int km = input->getKeyboardMode();
 
@@ -47,42 +47,29 @@ void eRCConsoleDriver::keyPressed(int)
 
        while (num--)
        {
-//             eDebug("console code %08x\n", *d);
-               if (km == eRCInput::kmAll)
-                       code = *d++;
-               else
-               {
-                       if (*d == 27) // escape code
-                       {
-                               while (num)
-                               {
-                                       num--;
-                                       if (*++d != '[')
-                                               break;
-                               }
-                               code = -1;
-                       } else
-                               code = *d;
-                       ++d;
-
-                       if (code < 32)                  /* control characters */
-                               code = -1;
-                       else switch(code)
-                       {
-                       case 0x7E:  // mute, einfg, entf
-                       case 0x7F:  // backspace
-                       code = -1;
-                       default:
-                               break;
+               code = *d++;
+//             eDebug("console code %02x\n", code);
+               if (km == eRCInput::kmAscii) {
+                       if (m_escape) {
+                               if (code != '[')
+                                       m_escape = false;
+                               continue;
                        }
+
+                       if (code == 27) // escape code
+                               m_escape = true;
+
+                       if ((code < 32) ||      // control characters
+                           (code == 0x7e) ||   // mute, einfg, entf
+                           (code == 0x7f))     // backspace
+                               continue;
                }
 
-               if (code != -1)
-                       for (std::list<eRCDevice*>::iterator i(listeners.begin()); i!=listeners.end(); ++i)
-                       {
-//                             eDebug("ascii %08x", code);
-                               (*i)->handleCode(code);
-                       }
+               for (std::list<eRCDevice*>::iterator i(listeners.begin()); i!=listeners.end(); ++i)
+               {
+//                     eDebug("ascii %02x", code);
+                       (*i)->handleCode(code);
+               }
        }
 }
 
index 85234d5..8a24612 100644 (file)
@@ -10,6 +10,7 @@ class eRCConsoleDriver: public eRCDriver
 protected:
        int handle;
        ePtr<eSocketNotifier> sn;
+       bool m_escape;
        void keyPressed(int);
 public:
        eRCConsoleDriver(const char *filename);
diff --git a/lib/driver/rcsdl.cpp b/lib/driver/rcsdl.cpp
new file mode 100644 (file)
index 0000000..a907b80
--- /dev/null
@@ -0,0 +1,390 @@
+#include <lib/driver/rcsdl.h>
+//#include <lib/actions/action.h>
+#include <lib/base/init.h>
+#include <lib/base/init_num.h>
+#include <lib/driver/input_fake.h>
+
+/*
+ * eSDLInputDevice
+ */
+
+eSDLInputDevice::eSDLInputDevice(eRCDriver *driver) : eRCDevice("SDL", driver), m_escape(false), m_unicode(0)
+{
+}
+
+eSDLInputDevice::~eSDLInputDevice()
+{
+}
+
+void eSDLInputDevice::handleCode(long arg)
+{
+       const SDL_KeyboardEvent *event = (const SDL_KeyboardEvent *)arg;
+       const SDL_keysym *key = &event->keysym;
+       int km = input->getKeyboardMode();
+       int code, flags;
+
+       if (event->type == SDL_KEYDOWN) {
+               m_unicode = key->unicode;
+               flags = eRCKey::flagMake;
+       } else {
+               flags = eRCKey::flagBreak;
+       }
+
+       if (km == eRCInput::kmNone) {
+               code = translateKey(key->sym);
+       } else {
+               eDebug("unicode=%04x scancode=%02x", m_unicode, key->scancode);
+               if (m_unicode & 0xff80) {
+                       eDebug("SDL: skipping unicode character");
+                       return;
+               }
+               code = m_unicode & ~0xff80;
+               // unicode not set...!? use key symbol
+               if (code == 0) {
+                       // keysym is ascii
+                       if (key->sym >= 128) {
+                               eDebug("SDL: cannot emulate ASCII");
+                               return;
+                       }
+                       eDebug("SDL: emulate ASCII");
+                       code = key->sym;
+               }
+               if (km == eRCInput::kmAscii) {
+                       // skip ESC c or ESC '[' c
+                       if (m_escape) {
+                               if (code != '[')
+                                       m_escape = false;
+                               return;
+                       }
+
+                       if (code == SDLK_ESCAPE)
+                               m_escape = true;
+
+                       if ((code < SDLK_SPACE) ||
+                           (code == 0x7e) ||   // really?
+                           (code == SDLK_DELETE))
+                               return;
+               }
+               flags |= eRCKey::flagAscii;
+       }
+
+       eDebug("SDL code=%d flags=%d", code, flags);
+       input->keyPressed(eRCKey(this, code, flags));
+}
+
+const char *eSDLInputDevice::getDescription() const
+{
+       return "SDL";
+}
+
+int eSDLInputDevice::translateKey(SDLKey key)
+{
+       #define P(a)    case SDLK_##a: return KEY_##a
+       #define P2(a,b) case SDLK_##a: return KEY_##b
+
+       switch (key) {
+       P(BACKSPACE);
+       P(TAB);
+       P(CLEAR);
+       P2(RETURN,ENTER);
+       P(PAUSE);
+       P2(ESCAPE,ESC);
+       P(SPACE);
+#if 0
+       P(EXCLAIM);
+       P(QUOTEDBL);
+       P(HASH);
+#endif
+       P(DOLLAR);
+#if 0
+       P(AMPERSAND);
+#endif
+       P2(QUOTE,APOSTROPHE);
+#if 0
+       P(LEFTPAREN);
+       P(RIGHTPAREN);
+       P(ASTERISK);
+       P(PLUS);
+#endif
+       P(COMMA);
+       P(MINUS);
+       P2(PERIOD,DOT);
+       P(SLASH);
+       P(0);
+       P(1);
+       P(2);
+       P(3);
+       P(4);
+       P(5);
+       P(6);
+       P(7);
+       P(8);
+       P(9);
+#if 0
+       P(COLON);
+#endif
+       P(SEMICOLON);
+#if 0
+       P(LESS);
+#endif
+       P2(EQUALS,EQUAL);
+#if 0
+       P(GREATER);
+#endif
+       P(QUESTION);
+#if 0
+       P(AT);
+#endif
+       P2(LEFTBRACKET,LEFTBRACE);
+       P(BACKSLASH);
+       P2(RIGHTBRACKET,RIGHTBRACE);
+       P2(CARET,GRAVE);
+#if 0
+       P(UNDERSCORE);
+       P(BACKQUOTE);
+#endif
+       P2(a,A);
+       P2(b,B);
+       P2(c,C);
+       P2(d,D);
+       P2(e,E);
+       P2(f,F);
+       P2(g,G);
+       P2(h,H);
+       P2(i,I);
+       P2(j,J);
+       P2(k,K);
+       P2(l,L);
+       P2(m,M);
+       P2(n,N);
+       P2(o,O);
+       P2(p,P);
+       P2(q,Q);
+       P2(r,R);
+       P2(s,S);
+       P2(t,T);
+       P2(u,U);
+       P2(v,V);
+       P2(w,W);
+       P2(x,X);
+       P2(y,Y);
+       P2(z,Z);
+       P(DELETE);
+#if 0
+       P(WORLD_0);
+       P(WORLD_1);
+       P(WORLD_2);
+       P(WORLD_3);
+       P(WORLD_4);
+       P(WORLD_5);
+       P(WORLD_6);
+       P(WORLD_7);
+       P(WORLD_8);
+       P(WORLD_9);
+       P(WORLD_10);
+       P(WORLD_11);
+       P(WORLD_12);
+       P(WORLD_13);
+       P(WORLD_14);
+       P(WORLD_15);
+       P(WORLD_16);
+       P(WORLD_17);
+       P(WORLD_18);
+       P(WORLD_19);
+       P(WORLD_20);
+       P(WORLD_21);
+       P(WORLD_22);
+       P(WORLD_23);
+       P(WORLD_24);
+       P(WORLD_25);
+       P(WORLD_26);
+       P(WORLD_27);
+       P(WORLD_28);
+       P(WORLD_29);
+       P(WORLD_30);
+       P(WORLD_31);
+       P(WORLD_32);
+       P(WORLD_33);
+       P(WORLD_34);
+       P(WORLD_35);
+       P(WORLD_36);
+       P(WORLD_37);
+       P(WORLD_38);
+       P(WORLD_39);
+       P(WORLD_40);
+       P(WORLD_41);
+       P(WORLD_42);
+       P(WORLD_43);
+       P(WORLD_44);
+       P(WORLD_45);
+       P(WORLD_46);
+       P(WORLD_47);
+       P(WORLD_48);
+       P(WORLD_49);
+       P(WORLD_50);
+       P(WORLD_51);
+       P(WORLD_52);
+       P(WORLD_53);
+       P(WORLD_54);
+       P(WORLD_55);
+       P(WORLD_56);
+       P(WORLD_57);
+       P(WORLD_58);
+       P(WORLD_59);
+       P(WORLD_60);
+       P(WORLD_61);
+       P(WORLD_62);
+       P(WORLD_63);
+       P(WORLD_64);
+       P(WORLD_65);
+       P(WORLD_66);
+       P(WORLD_67);
+       P(WORLD_68);
+       P(WORLD_69);
+       P(WORLD_70);
+       P(WORLD_71);
+       P(WORLD_72);
+       P(WORLD_73);
+       P(WORLD_74);
+       P(WORLD_75);
+       P(WORLD_76);
+       P(WORLD_77);
+       P(WORLD_78);
+       P(WORLD_79);
+       P(WORLD_80);
+       P(WORLD_81);
+       P(WORLD_82);
+       P(WORLD_83);
+       P(WORLD_84);
+       P(WORLD_85);
+       P(WORLD_86);
+       P(WORLD_87);
+       P(WORLD_88);
+       P(WORLD_89);
+       P(WORLD_90);
+       P(WORLD_91);
+       P(WORLD_92);
+       P(WORLD_93);
+       P(WORLD_94);
+       P(WORLD_95);
+#endif
+       P(KP0);
+       P(KP1);
+       P(KP2);
+       P(KP3);
+       P(KP4);
+       P(KP5);
+       P(KP6);
+       P(KP7);
+       P(KP8);
+       P(KP9);
+       P2(KP_PERIOD,KPDOT);
+       P2(KP_DIVIDE,KPSLASH);
+       P2(KP_MULTIPLY,KPASTERISK);
+       P2(KP_MINUS,KPMINUS);
+       P2(KP_PLUS,KPPLUS);
+       P2(KP_ENTER,KPENTER);
+       P2(KP_EQUALS,KPEQUAL);
+       P(UP);
+       P(DOWN);
+       P(RIGHT);
+       P(LEFT);
+       P(INSERT);
+       P(HOME);
+       P(END);
+       P(PAGEUP);
+       P(PAGEDOWN);
+       P(F1);
+       P(F2);
+       P(F3);
+       P(F4);
+       P(F5);
+       P(F6);
+       P(F7);
+       P(F8);
+       P(F9);
+       P(F10);
+       P(F11);
+       P(F12);
+       P(F13);
+       P(F14);
+       P(F15);
+       P(NUMLOCK);
+       P(CAPSLOCK);
+       P2(SCROLLOCK,SCROLLLOCK);
+       P2(RSHIFT,RIGHTSHIFT);
+       P2(LSHIFT,LEFTSHIFT);
+       P2(RCTRL,RIGHTCTRL);
+       P2(LCTRL,LEFTCTRL);
+       P2(RALT,RIGHTALT);
+       P2(LALT,LEFTALT);
+       P2(RMETA,RIGHTMETA);
+       P2(LMETA,LEFTMETA);
+#if 0
+       P(LSUPER);
+       P(RSUPER);
+#endif
+       P(MODE);
+       P(COMPOSE);
+       P(HELP);
+       P(PRINT);
+       P2(SYSREQ,SYSRQ);
+       P(BREAK);
+       P(MENU);
+       P(POWER);
+       P(EURO);
+       P(UNDO);
+       default:
+               eDebug("unhandled SDL keycode: %d", key);
+               return KEY_RESERVED;
+       }
+
+       #undef P2
+       #undef P
+}
+
+/*
+ * eSDLInputDriver
+ */
+
+eSDLInputDriver *eSDLInputDriver::instance;
+
+eSDLInputDriver::eSDLInputDriver() : eRCDriver(eRCInput::getInstance())
+{
+       ASSERT(instance == 0);
+       instance = this;
+}
+
+eSDLInputDriver::~eSDLInputDriver()
+{
+       instance = 0;
+}
+
+void eSDLInputDriver::keyPressed(const SDL_KeyboardEvent *key)
+{
+       eDebug("km=%d enabled=%d locked=%d",
+               input->getKeyboardMode(), enabled, input->islocked());
+
+       if (!enabled || input->islocked())
+               return;
+
+       std::list<eRCDevice*>::iterator i(listeners.begin());
+       while (i != listeners.end()) {
+               (*i)->handleCode((long)key);
+               ++i;
+       }
+}
+
+class eRCSDLInit
+{
+private:
+       eSDLInputDriver driver;
+       eSDLInputDevice device;
+
+public:
+       eRCSDLInit(): driver(), device(&driver)
+       {
+       }
+};
+
+eAutoInitP0<eRCSDLInit> init_rcSDL(eAutoInitNumbers::rc+1, "SDL RC Driver");
diff --git a/lib/driver/rcsdl.h b/lib/driver/rcsdl.h
new file mode 100644 (file)
index 0000000..9732f5e
--- /dev/null
@@ -0,0 +1,37 @@
+#ifndef __lib_driver_rcsdl_h
+#define __lib_driver_rcsdl_h
+
+#include <lib/driver/rc.h>
+
+#include <SDL.h>
+
+class eSDLInputDevice : public eRCDevice
+{
+private:
+       bool m_escape;
+       unsigned int m_unicode;
+       int translateKey(SDLKey key);
+
+public:
+       eSDLInputDevice(eRCDriver *driver);
+       ~eSDLInputDevice();
+
+       virtual void handleCode(long arg);
+       virtual const char *getDescription() const;
+};
+
+class eSDLInputDriver : public eRCDriver
+{
+private:
+       static eSDLInputDriver *instance;
+
+public:
+       eSDLInputDriver();
+       ~eSDLInputDriver();
+
+       static eSDLInputDriver *getInstance() { return instance; }
+
+       void keyPressed(const SDL_KeyboardEvent *key);
+};
+
+#endif
index b47ffed..9b33755 100644 (file)
@@ -1,12 +1,64 @@
 SUBDIRS = lowlevel
 
-INCLUDES = \
-       -I$(top_srcdir)/include
+AM_CPPFLAGS = \
+       -I$(top_srcdir) \
+       -I$(top_srcdir)/include \
+       -include Python.h \
+       -include $(top_builddir)/enigma2_config.h
 
 noinst_LIBRARIES = libenigma_dvb.a
 
-libenigma_dvb_a_SOURCES = dvb.cpp demux.cpp frontend.cpp esection.cpp db.cpp \
-       sec.cpp scan.cpp crc32.cpp pmt.cpp decoder.cpp eit.cpp rotor_calc.cpp \
-       epgcache.cpp dvbtime.cpp metaparser.cpp volume.cpp tstools.cpp pvrparse.cpp \
-       pesparse.cpp teletext.cpp radiotext.cpp subtitle.cpp
+libenigma_dvb_a_SOURCES = \
+       crc32.cpp \
+       db.cpp \
+       decoder.cpp \
+       demux.cpp \
+       dvb.cpp \
+       dvbtime.cpp \
+       eit.cpp \
+       epgcache.cpp \
+       esection.cpp \
+       frontend.cpp \
+       metaparser.cpp \
+       pesparse.cpp \
+       pmt.cpp \
+       pvrparse.cpp \
+       radiotext.cpp \
+       rotor_calc.cpp \
+       scan.cpp \
+       sec.cpp \
+       subtitle.cpp \
+       teletext.cpp \
+       tstools.cpp \
+       volume.cpp
 
+dvbincludedir = $(pkgincludedir)/lib/dvb
+dvbinclude_HEADERS = \
+       crc32.h \
+       db.h \
+       decoder.h \
+       demux.h \
+       dvb.h \
+       dvbtime.h \
+       eit.h \
+       epgcache.h \
+       esection.h \
+       frontend.h \
+       frontendparms.h \
+       idemux.h \
+       idvb.h \
+       isection.h \
+       list.h \
+       metaparser.h \
+       pesparse.h \
+       pmt.h \
+       pvrparse.h \
+       radiotext.h \
+       rotor_calc.h \
+       scan.h \
+       sec.h \
+       specs.h \
+       subtitle.h \
+       teletext.h \
+       tstools.h \
+       volume.h
index 38be635..522035e 100644 (file)
@@ -3,6 +3,7 @@
 #include <lib/dvb/dvb.h>
 #include <lib/dvb/frontend.h>
 #include <lib/dvb/epgcache.h>
+#include <lib/base/eenv.h>
 #include <lib/base/eerror.h>
 #include <lib/base/estring.h>
 #include <xmlccwrap/xmlccwrap.h>
@@ -73,7 +74,7 @@ RESULT eBouquet::moveService(const eServiceReference &ref, unsigned int pos)
 
 RESULT eBouquet::flushChanges()
 {
-       FILE *f=fopen((CONFIGDIR"/enigma2/"+m_filename).c_str(), "w");
+       FILE *f=fopen(eEnv::resolve("${sysconfdir}/enigma2/" + m_filename).c_str(), "w");
        if (!f)
                return -1;
        if ( fprintf(f, "#NAME %s\r\n", m_bouquet_name.c_str()) < 0 )
@@ -280,7 +281,7 @@ DEFINE_REF(eDVBDB);
 
 void eDVBDB::reloadServicelist()
 {
-       loadServicelist(CONFIGDIR"/enigma2/lamedb");
+       loadServicelist(eEnv::resolve("${sysconfdir}/enigma2/lamedb").c_str());
 }
 
 void eDVBDB::parseServiceData(ePtr<eDVBService> s, std::string str)
@@ -324,14 +325,14 @@ void eDVBDB::loadServicelist(const char *file)
 {
        eDebug("---- opening lame channel db");
        FILE *f=fopen(file, "rt");
-       if (!f && strcmp(file, CONFIGDIR"/enigma2/lamedb") == 0)
+       if (!f && strcmp(file, eEnv::resolve("${sysconfdir}/enigma2/lamedb").c_str()) == 0)
        {
                struct stat s;
                if ( !stat("lamedb", &s) )
                {
-                       if ( !stat(CONFIGDIR"/enigma2", &s) )
+                       if ( !stat(eEnv::resolve("${sysconfdir}/enigma2").c_str(), &s) )
                        {
-                               rename("lamedb", CONFIGDIR"/enigma2/lamedb" );
+                               rename("lamedb", eEnv::resolve("${sysconfdir}/enigma2/lamedb").c_str());
                                reloadServicelist();
                        }
                }
@@ -594,7 +595,7 @@ void eDVBDB::saveServicelist(const char *file)
 
 void eDVBDB::saveServicelist()
 {
-       saveServicelist(CONFIGDIR"/enigma2/lamedb");
+       saveServicelist(eEnv::resolve("${sysconfdir}/enigma2/lamedb").c_str());
 }
 
 void eDVBDB::loadBouquet(const char *path)
@@ -618,7 +619,7 @@ void eDVBDB::loadBouquet(const char *path)
        std::list<eServiceReference> &list = bouquet.m_services;
        list.clear();
 
-       std::string p = CONFIGDIR"/enigma2/";
+       std::string p = eEnv::resolve("${sysconfdir}/enigma2/");
        p+=path;
        eDebug("loading bouquet... %s", p.c_str());
        FILE *fp=fopen(p.c_str(), "rt");
index ebdad8a..ea9e738 100644 (file)
@@ -2111,8 +2111,8 @@ RESULT eDVBFrontend::prepare_sat(const eDVBFrontendParametersSatellite &feparm,
                                        return -EINVAL;
                        }
 #if HAVE_DVB_API_VERSION < 5
-                       parm_inversion |= (feparm.rolloff << 2); // Hack.. we use bit 2..3 of inversion param for rolloff
-                       parm_inversion |= (feparm.pilot << 4); // Hack.. we use bit 4..5 of inversion param for pilot
+                       parm_inversion = (fe_spectral_inversion_t)((feparm.rolloff << 2) | parm_inversion); // Hack.. we use bit 2..3 of inversion param for rolloff
+                       parm_inversion = (fe_spectral_inversion_t)((feparm.pilot << 4) | parm_inversion); // Hack.. we use bit 4..5 of inversion param for pilot
                        if (feparm.modulation == eDVBFrontendParametersSatellite::Modulation_8PSK) 
                        {
                                parm_u_qpsk_fec_inner = (fe_code_rate_t)((int)parm_u_qpsk_fec_inner+9);
index 98e89f9..1108097 100644 (file)
@@ -1,3 +1,4 @@
-EXTRA_DIST = \
+lowlevelincludedir = $(pkgincludedir)/lib/dvb/lowlevel
+lowlevelinclude_HEADERS = \
        eit.h \
        mhw.h
index dc2e9a8..4ad4e76 100644 (file)
@@ -180,7 +180,7 @@ void eDVBServicePMTHandler::PATready(int)
                serviceEvent(eventNoPAT);
 }
 
-PyObject *eDVBServicePMTHandler::getCaIds()
+PyObject *eDVBServicePMTHandler::getCaIds(bool pair)
 {
        ePyObject ret;
 
@@ -188,20 +188,37 @@ PyObject *eDVBServicePMTHandler::getCaIds()
 
        if ( !getProgramInfo(prog) )
        {
-               int cnt=prog.caids.size();
-               if (cnt)
+               if (pair)
                {
+                       int cnt=prog.caids.size();
+                       if (cnt)
+                       {
+                               ret=PyList_New(cnt);
+                               std::list<program::capid_pair>::iterator it(prog.caids.begin());
+                               while(cnt--)
+                               {
+                                       ePyObject tuple = PyTuple_New(2);
+                                       PyTuple_SET_ITEM(tuple, 0, PyInt_FromLong(it->caid));
+                                       PyTuple_SET_ITEM(tuple, 1, PyInt_FromLong((it++)->capid));
+                                       PyList_SET_ITEM(ret, cnt, tuple);
+                               }
+                       }
+               }
+               else
+               {
+                       std::set<program::capid_pair> set(prog.caids.begin(), prog.caids.end());
+                       std::set<program::capid_pair>::iterator it(set.begin());
+                       int cnt=set.size();
                        ret=PyList_New(cnt);
-                       std::set<uint16_t>::iterator it(prog.caids.begin());
                        while(cnt--)
-                               PyList_SET_ITEM(ret, cnt, PyInt_FromLong(*it++));
+                               PyList_SET_ITEM(ret, cnt, PyInt_FromLong((it++)->caid));
                }
        }
 
        return ret ? (PyObject*)ret : (PyObject*)PyList_New(0);
 }
 
-int eDVBServicePMTHandler::getProgramInfo(struct program &program)
+int eDVBServicePMTHandler::getProgramInfo(program &program)
 {
        ePtr<eTable<ProgramMapSection> > ptr;
        int cached_apid_ac3 = -1;
@@ -254,7 +271,10 @@ int eDVBServicePMTHandler::getProgramInfo(struct program &program)
                                        if ((*desc)->getTag() == CA_DESCRIPTOR)
                                        {
                                                CaDescriptor *descr = (CaDescriptor*)(*desc);
-                                               program.caids.insert(descr->getCaSystemId());
+                                               program::capid_pair pair;
+                                               pair.caid = descr->getCaSystemId();
+                                               pair.capid = descr->getCaPid();
+                                               program.caids.push_back(pair);
                                        }
                                        else if ((*desc)->getTag() == REGISTRATION_DESCRIPTOR)
                                        {
@@ -518,7 +538,10 @@ int eDVBServicePMTHandler::getProgramInfo(struct program &program)
                                                        case CA_DESCRIPTOR:
                                                        {
                                                                CaDescriptor *descr = (CaDescriptor*)(*desc);
-                                                               program.caids.insert(descr->getCaSystemId());
+                                                               program::capid_pair pair;
+                                                               pair.caid = descr->getCaSystemId();
+                                                               pair.capid = descr->getCaPid();
+                                                               program.caids.push_back(pair);
                                                                break;
                                                        }
                                                        default:
@@ -638,8 +661,12 @@ int eDVBServicePMTHandler::getProgramInfo(struct program &program)
                        program.textPid = cached_tpid;
                }
                CAID_LIST &caids = m_service->m_ca;
-               for (CAID_LIST::iterator it(caids.begin()); it != caids.end(); ++it)
-                       program.caids.insert(*it);
+               for (CAID_LIST::iterator it(caids.begin()); it != caids.end(); ++it) {
+                       program::capid_pair pair;
+                       pair.caid = *it;
+                       pair.capid = -1; // not known yet
+                       program.caids.push_back(pair);
+               }
                if ( cnt )
                        ret = 0;
        }
index e9816b4..1888e05 100644 (file)
@@ -182,11 +182,17 @@ public:
 
        struct program
        {
+               struct capid_pair
+               {
+                       uint16_t caid;
+                       int capid;
+                       bool operator< (const struct capid_pair &t) const { return t.caid < caid; }
+               };
                std::vector<videoStream> videoStreams;
                std::vector<audioStream> audioStreams;
                int defaultAudioStream;
                std::vector<subtitleStream> subtitleStreams;
-               std::set<uint16_t> caids;
+               std::list<capid_pair> caids;
                int pcrPid;
                int pmtPid;
                int textPid;
@@ -194,10 +200,10 @@ public:
                PyObject *createPythonObject();
        };
 
-       int getProgramInfo(struct program &program);
+       int getProgramInfo(program &program);
        int getDataDemux(ePtr<iDVBDemux> &demux);
        int getDecodeDemux(ePtr<iDVBDemux> &demux);
-       PyObject *getCaIds();
+       PyObject *getCaIds(bool pair=false); // caid / ecmpid pair
        
        int getPVRChannel(ePtr<iDVBPVRChannel> &pvr_channel);
        int getServiceReference(eServiceReferenceDVB &service) { service = m_reference; return 0; }
index 5cdecbd..e19dd1e 100644 (file)
@@ -123,7 +123,7 @@ void eMPEGStreamInformation::fixupDiscontinuties()
                pts_t current = i->second - currentDelta;
                pts_t diff = current - lastpts_t;
                
-               if (llabs(diff) > (90000*5)) // 5sec diff
+               if (llabs(diff) > (90000*10)) // 10sec diff
                {
 //                     eDebug("%llx < %llx, have discont. new timestamp is %llx (diff is %llx)!", current, lastpts_t, i->second, diff);
                        currentDelta = i->second - lastpts_t; /* FIXME: should be the extrapolated new timestamp, based on the current rate */
index b37aa71..d559614 100644 (file)
@@ -10,6 +10,7 @@
 #include <lib/dvb/esection.h>
 #include <lib/dvb/scan.h>
 #include <lib/dvb/frontend.h>
+#include <lib/base/eenv.h>
 #include <lib/base/eerror.h>
 #include <lib/base/estring.h>
 #include <lib/python/python.h>
@@ -29,7 +30,8 @@ eDVBScan::eDVBScan(iDVBChannel *channel, bool usePAT, bool debug)
        if (m_channel->getDemux(m_demux))
                SCAN_eDebug("scan: failed to allocate demux!");
        m_channel->connectStateChange(slot(*this, &eDVBScan::stateChange), m_stateChanged_connection);
-       FILE *f = fopen("/etc/enigma2/scan_tp_valid_check.py", "r");
+       std::string filename = eEnv::resolve("${sysconfdir}/scan_tp_valid_check.py");
+       FILE *f = fopen(filename.c_str(), "r");
        if (f)
        {
                char code[16384];
@@ -37,7 +39,7 @@ eDVBScan::eDVBScan(iDVBChannel *channel, bool usePAT, bool debug)
                if (rd)
                {
                        code[rd]=0;
-                       m_additional_tsid_onid_check_func = Py_CompileString(code, "/etc/enigma2/scan_tp_valid_check.py", Py_file_input);
+                       m_additional_tsid_onid_check_func = Py_CompileString(code, filename.c_str(), Py_file_input);
                }
                fclose(f);
        }
index d48d44e..a2bc886 100644 (file)
@@ -212,7 +212,7 @@ int eDVBSatelliteEquipmentControl::canTune(const eDVBFrontendParametersSatellite
 
                                eSecDebugNoSimulate("ret5 %d", ret);
 
-                               if (ret && lnb_param.SatCR_idx == -1)
+                               if (ret && !is_unicable)
                                {
                                        int lof = sat.frequency > lnb_param.m_lof_threshold ?
                                                lnb_param.m_lof_hi : lnb_param.m_lof_lo;
@@ -300,11 +300,6 @@ RESULT eDVBSatelliteEquipmentControl::prepare(iDVBFrontend &frontend, FRONTENDPA
                if ( sit != lnb_param.m_satellites.end())
                {
                        eSecCommandList sec_sequence;
-
-                       lnb_param.guard_offset = 0; //HACK
-
-                       frontend.setData(eDVBFrontend::SATCR, lnb_param.SatCR_idx);
-                       
                        eDVBSatelliteSwitchParameters &sw_param = sit->second;
                        bool doSetFrontend = true;
                        bool doSetVoltageToneFrontend = true;
@@ -327,6 +322,11 @@ RESULT eDVBSatelliteEquipmentControl::prepare(iDVBFrontend &frontend, FRONTENDPA
                        eDVBSatelliteDiseqcParameters::t_diseqc_mode diseqc_mode = di_param.m_diseqc_mode;
                        eDVBSatelliteSwitchParameters::t_voltage_mode voltage_mode = sw_param.m_voltage_mode;
                        bool diseqc13V = voltage_mode == eDVBSatelliteSwitchParameters::HV_13;
+                       bool is_unicable = lnb_param.SatCR_idx != -1;
+
+                       lnb_param.guard_offset = 0; //HACK
+
+                       frontend.setData(eDVBFrontend::SATCR, lnb_param.SatCR_idx);
 
                        if (diseqc13V)
                                voltage_mode = eDVBSatelliteSwitchParameters::HV;
@@ -371,13 +371,10 @@ RESULT eDVBSatelliteEquipmentControl::prepare(iDVBFrontend &frontend, FRONTENDPA
 
                        int lof = (band&1)?lnb_param.m_lof_hi:lnb_param.m_lof_lo;
 
-                       int local=0;
-
-
-                       if(lnb_param.SatCR_idx == -1)
+                       if(!is_unicable)
                        {
-                       // calc Frequency
-                               local = abs(sat.frequency 
+                               // calc Frequency
+                               int local= abs(sat.frequency 
                                        - lof);
                                parm.FREQUENCY = ((((local * 2) / 125) + 1) / 2) * 125;
                                frontend.setData(eDVBFrontend::FREQ_OFFSET, sat.frequency - parm.FREQUENCY);
@@ -551,6 +548,7 @@ RESULT eDVBSatelliteEquipmentControl::prepare(iDVBFrontend &frontend, FRONTENDPA
 
                                        if ( send_mask )
                                        {
+                                               int diseqc_repeats = diseqc_mode > eDVBSatelliteDiseqcParameters::V1_0 ? di_param.m_repeats : 0;
                                                int vlt = iDVBFrontend::voltageOff;
                                                eSecCommand::pair compare;
                                                compare.steps = +3;
@@ -623,7 +621,7 @@ RESULT eDVBSatelliteEquipmentControl::prepare(iDVBFrontend &frontend, FRONTENDPA
                                                        if ( send_mask & 2 )
                                                                ++loops;
 
-                                                       loops <<= di_param.m_repeats;
+                                                       loops <<= diseqc_repeats;
 
                                                        for ( int i = 0; i < loops;)  // fill commands...
                                                        {
@@ -660,7 +658,7 @@ RESULT eDVBSatelliteEquipmentControl::prepare(iDVBFrontend &frontend, FRONTENDPA
                                                                        int tmp = m_params[DELAY_BETWEEN_DISEQC_REPEATS];
                                                                        if (cmd)
                                                                        {
-                                                                               int delay = di_param.m_repeats ? (tmp - 54) / 2 : tmp;  // standard says 100msek between two repeated commands
+                                                                               int delay = diseqc_repeats ? (tmp - 54) / 2 : tmp;  // standard says 100msek between two repeated commands
                                                                                sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, delay) );
                                                                                diseqc.data[2]=cmd;
                                                                                diseqc.data[3]=(cmd==0x38) ? csw : ucsw;
@@ -693,7 +691,7 @@ RESULT eDVBSatelliteEquipmentControl::prepare(iDVBFrontend &frontend, FRONTENDPA
                                        if ( RotorCmd != -1 && RotorCmd != lastRotorCmd )
                                        {
                                                eSecCommand::pair compare;
-                                               if (!send_mask && lnb_param.SatCR_idx == -1)
+                                               if (!send_mask && !is_unicable)
                                                {
                                                        compare.steps = +3;
                                                        compare.tone = iDVBFrontend::toneOff;
@@ -747,10 +745,10 @@ RESULT eDVBSatelliteEquipmentControl::prepare(iDVBFrontend &frontend, FRONTENDPA
                                                        diseqc.data[3] = RotorCmd;
                                                        diseqc.data[4] = 0x00;
                                                }
-//                                             if(lnb_param.SatCR_idx == -1)
+//                                             if(!is_unicable)
                                                {
                                                        int mrt = m_params[MOTOR_RUNNING_TIMEOUT]; // in seconds!
-                                                       if ( rotor_param.m_inputpower_parameters.m_use || lnb_param.SatCR_idx == -1)
+                                                       if ( rotor_param.m_inputpower_parameters.m_use && !is_unicable)
                                                        { // use measure rotor input power to detect rotor state
                                                                bool turn_fast = need_turn_fast(rotor_param.m_inputpower_parameters.m_turning_speed);
                                                                eSecCommand::rotor cmd;
@@ -882,7 +880,7 @@ RESULT eDVBSatelliteEquipmentControl::prepare(iDVBFrontend &frontend, FRONTENDPA
                        sec_fe->setData(eDVBFrontend::NEW_UCSW, ucsw);
                        sec_fe->setData(eDVBFrontend::NEW_TONEBURST, di_param.m_toneburst_param);
 
-                       if ((doSetVoltageToneFrontend) && (lnb_param.SatCR_idx == -1))
+                       if (doSetVoltageToneFrontend && !is_unicable)
                        {
                                eSecCommand::pair compare;
                                compare.voltage = voltage;
@@ -898,7 +896,7 @@ RESULT eDVBSatelliteEquipmentControl::prepare(iDVBFrontend &frontend, FRONTENDPA
 
                        sec_sequence.push_back( eSecCommand(eSecCommand::UPDATE_CURRENT_SWITCHPARMS) );
 
-                       if(lnb_param.SatCR_idx != -1)
+                       if(is_unicable)
                        {
                                // check if voltage is disabled
                                eSecCommand::pair compare;
index e93cfc0..6cd855c 100644 (file)
@@ -40,7 +40,7 @@ int eDVBTSTools::openFile(const char *filename, int nostreaminfo)
        if (f->open(filename, 1) < 0)
                return -1;
 
-       setSource(src, filename);
+       setSource(src, nostreaminfo ? NULL : filename);
 
        return 0;
 }
@@ -702,9 +702,26 @@ int eDVBTSTools::findFrame(off_t &_offset, size_t &len, int &direction, int fram
                else if (direction == +1)
                        direction = 0;
        }
-                       /* let's find the next frame after the given offset */
        off_t start = offset;
 
+#if 0
+                       /* backtrack to find the previous sequence start, in case of MPEG2 */
+       if ((data & 0xFF) == 0x00) {
+               do {
+                       --start;
+                       if (m_streaminfo.getStructureEntry(start, data, 0))
+                       {
+                               eDebug("get previous failed");
+                               return -1;
+                       }
+               } while (((data & 0xFF) != 9) && ((data & 0xFF) != 0x00) && ((data & 0xFF) != 0xB3)); /* sequence start or previous frame */
+               if ((data & 0xFF) != 0xB3)
+                       start = offset;  /* Failed to find corresponding sequence start, so never mind */
+       }
+
+#endif
+
+                       /* let's find the next frame after the given offset */
        do {
                if (m_streaminfo.getStructureEntry(offset, data, 1))
                {
@@ -719,9 +736,11 @@ int eDVBTSTools::findFrame(off_t &_offset, size_t &len, int &direction, int fram
 //             eDebug("%08llx@%llx (next)", data, offset);
        } while (((data & 0xFF) != 9) && ((data & 0xFF) != 0x00)); /* next frame */
 
+#if 0
                        /* align to TS pkt start */
-//     start = start - (start % 188);
-//     offset = offset - (offset % 188);
+       start = start - (start % 188);
+       offset = offset - (offset % 188);
+#endif
 
        len = offset - start;
        _offset = start;
index fc7f762..9ef7249 100644 (file)
@@ -1,10 +1,28 @@
-INCLUDES = \
-       -I$(top_srcdir)/include
+AM_CPPFLAGS = \
+       -I$(top_srcdir) \
+       -I$(top_srcdir)/include \
+       -include Python.h \
+       -include $(top_builddir)/enigma2_config.h
 
 noinst_LIBRARIES = libenigma_dvb_ci.a
 
-libenigma_dvb_ci_a_SOURCES = dvbci.cpp dvbci_session.cpp dvbci_resmgr.cpp \
-                                                                                                                dvbci_appmgr.cpp dvbci_camgr.cpp \
-                                                                                                                dvbci_datetimemgr.cpp dvbci_mmi.cpp \
-                                                                                                                dvbci_ui.cpp
+libenigma_dvb_ci_a_SOURCES = \
+       dvbci.cpp \
+       dvbci_appmgr.cpp \
+       dvbci_camgr.cpp \
+       dvbci_datetimemgr.cpp \
+       dvbci_mmi.cpp \
+       dvbci_resmgr.cpp \
+       dvbci_session.cpp \
+       dvbci_ui.cpp
 
+dvbciincludedir = $(pkgincludedir)/lib/dvb_ci
+dvbciinclude_HEADERS = \
+       dvbci.h \
+       dvbci_appmgr.h \
+       dvbci_camgr.h \
+       dvbci_datetimemgr.h \
+       dvbci_mmi.h \
+       dvbci_resmgr.h \
+       dvbci_session.h \
+       dvbci_ui.h
index 883fb5a..8a43e5b 100644 (file)
@@ -297,8 +297,9 @@ void eDVBCIInterfaces::recheckPMTHandlers()
                if (!pmthandler->getProgramInfo(p))
                {
                        int cnt=0;
-                       for (caidSet::reverse_iterator x(p.caids.rbegin()); x != p.caids.rend(); ++x, ++cnt)
-                               caids.push_front(*x);
+                       std::set<eDVBServicePMTHandler::program::capid_pair> set(p.caids.begin(), p.caids.end());
+                       for (std::set<eDVBServicePMTHandler::program::capid_pair>::reverse_iterator x(set.rbegin()); x != set.rend(); ++x, ++cnt)
+                               caids.push_front(x->caid);
                        if (service && cnt)
                                service->m_ca = caids;
                }
index 1280556..20321f5 100644 (file)
@@ -1,15 +1,58 @@
-INCLUDES = \
-       -I$(top_srcdir)/include -I$(top_srcdir)/lib/gdi/ati
+AM_CPPFLAGS = \
+       -I$(top_srcdir) \
+       -I$(top_srcdir)/include \
+       -include Python.h \
+       -include $(top_builddir)/enigma2_config.h
+
+AM_CXXFLAGS = \
+       $(LIBSDL_CFLAGS)
 
 noinst_LIBRARIES = libenigma_gdi.a
 
 libenigma_gdi_a_SOURCES = \
-       region.cpp grc.cpp epng.cpp erect.cpp fb.cpp font.cpp font_arabic.cpp gfbdc.cpp  \
-       glcddc.cpp gpixmap.cpp lcd.cpp gfont.cpp accel.cpp picload.cpp picexif.cpp \
-       compositing.cpp bcm.cpp
+       accel.cpp \
+       bcm.cpp \
+       compositing.cpp \
+       epng.cpp \
+       erect.cpp \
+       fb.cpp \
+       font.cpp \
+       font_arabic.cpp \
+       gfont.cpp \
+       glcddc.cpp \
+       gmaindc.cpp \
+       gpixmap.cpp \
+       grc.cpp \
+       lcd.cpp \
+       picexif.cpp \
+       picload.cpp \
+       region.cpp
 
-if WITH_SDL
-libenigma_gdi_a_SOURCES += sdl.cpp
-endif
+gdiincludedir = $(pkgincludedir)/lib/gdi
+gdiinclude_HEADERS = \
+       accel.h \
+       compositing.h \
+       epng.h \
+       epoint.h \
+       erect.h \
+       esize.h \
+       fb.h \
+       font.h \
+       gfont.h \
+       glcddc.h \
+       gpixmap.h \
+       grc.h \
+       lcd.h \
+       picexif.h \
+       picload.h \
+       region.h
 
-#      ati/2dablt.cpp ati/2dcore.cpp ati/ati_core.cpp ati/test.cpp ati/2dutil.cpp
+if HAVE_LIBSDL
+libenigma_gdi_a_SOURCES += \
+       sdl.cpp \
+       sdl.h
+else
+libenigma_gdi_a_SOURCES += \
+       gfbdc.cpp \
+       gfbdc.h
+endif
index 972a89d..fd33298 100644 (file)
@@ -1,3 +1,4 @@
+#define PNG_SKIP_SETJMP_CHECK
 #include <png.h>
 #include <stdio.h>
 #include <lib/gdi/epng.h>
index a5db43a..9e17547 100644 (file)
 // use this for init Freetype...
 #include <ft2build.h>
 #include FT_FREETYPE_H
-#ifdef HAVE_FREETYPE2
 #define FTC_Image_Cache_New(a,b)       FTC_ImageCache_New(a,b)
 #define FTC_Image_Cache_Lookup(a,b,c,d)        FTC_ImageCache_Lookup(a,b,c,d,NULL)
 #define FTC_SBit_Cache_New(a,b)                FTC_SBitCache_New(a,b)
 #define FTC_SBit_Cache_Lookup(a,b,c,d) FTC_SBitCache_Lookup(a,b,c,d,NULL)
-#endif
 
 #include <lib/base/eerror.h>
 #include <lib/gdi/lcd.h>
 #include <lib/base/init.h>
 #include <lib/base/init_num.h>
 
-#define HAVE_FRIBIDI
-// until we have it in the cdk
-
-#ifdef HAVE_FRIBIDI
 #include <fribidi/fribidi.h>
-#endif
 
 #include <map>
 
@@ -42,10 +35,6 @@ fontRenderClass *fontRenderClass::instance;
 
 static pthread_mutex_t ftlock=PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP;
 
-#ifndef HAVE_FREETYPE2
-static FTC_Font cache_current_font=0;
-#endif
-
 struct fntColorCacheKey
 {
        gRGB start, end;
@@ -210,12 +199,8 @@ float fontRenderClass::getLineHeight(const gFont& font)
                return 0;
        singleLock s(ftlock);
        FT_Face current_face;
-#ifdef HAVE_FREETYPE2
        if ((FTC_Manager_LookupFace(cacheManager, fnt->scaler.face_id, &current_face) < 0) ||
            (FTC_Manager_LookupSize(cacheManager, &fnt->scaler, &fnt->size) < 0))
-#else
-       if (FTC_Manager_Lookup_Size(cacheManager, &fnt->font.font, &current_face, &fnt->size)<0)
-#endif
        {
                eDebug("FTC_Manager_Lookup_Size failed!");
                return 0;
@@ -263,7 +248,6 @@ DEFINE_REF(Font);
 Font::Font(fontRenderClass *render, FTC_FaceID faceid, int isize, int tw): tabwidth(tw)
 {
        renderer=render;
-#ifdef HAVE_FREETYPE2
        font.face_id = faceid;
        font.width = isize;
        font.height = isize;
@@ -272,12 +256,6 @@ Font::Font(fontRenderClass *render, FTC_FaceID faceid, int isize, int tw): tabwi
        scaler.width = isize;
        scaler.height = isize;
        scaler.pixel = 1;
-#else
-       font.font.face_id=faceid;
-       font.font.pix_width     = isize;
-       font.font.pix_height = isize;
-       font.image_type = ftc_image_grays;
-#endif
        height=isize;
        if (tabwidth==-1)
                tabwidth=8*isize;
@@ -474,18 +452,12 @@ void eTextPara::setFont(Font *fnt, Font *replacement)
                        // we ask for replacment_font first becauseof the cache
        if (replacement_font)
        {
-#ifdef HAVE_FREETYPE2
                if ((FTC_Manager_LookupFace(fontRenderClass::instance->cacheManager,
                                            replacement_font->scaler.face_id,
                                            &replacement_face) < 0) ||
                    (FTC_Manager_LookupSize(fontRenderClass::instance->cacheManager,
                                            &replacement_font->scaler,
                                            &replacement_font->size) < 0))
-#else
-               if (FTC_Manager_Lookup_Size(fontRenderClass::instance->cacheManager, 
-                               &replacement_font->font.font, &replacement_face, 
-                               &replacement_font->size)<0)
-#endif
                {
                        eDebug("FTC_Manager_Lookup_Size failed!");
                        return;
@@ -493,24 +465,17 @@ void eTextPara::setFont(Font *fnt, Font *replacement)
        }
        if (current_font)
        {
-#ifdef HAVE_FREETYPE2
                if ((FTC_Manager_LookupFace(fontRenderClass::instance->cacheManager,
                                            current_font->scaler.face_id,
                                            &current_face) < 0) ||
                    (FTC_Manager_LookupSize(fontRenderClass::instance->cacheManager,
                                            &current_font->scaler,
                                            &current_font->size) < 0))
-#else
-               if (FTC_Manager_Lookup_Size(fontRenderClass::instance->cacheManager, &current_font->font.font, &current_face, &current_font->size)<0)
-#endif
                {
                        eDebug("FTC_Manager_Lookup_Size failed!");
                        return;
                }
        }
-#ifndef HAVE_FREETYPE2
-       cache_current_font=&current_font->font.font;
-#endif
        previous=0;
        use_kerning=FT_HAS_KERNING(current_face);
 }
@@ -525,7 +490,6 @@ int eTextPara::renderString(const char *string, int rflags)
        if (!current_font)
                return -1;
 
-#ifdef HAVE_FREETYPE2
        if ((FTC_Manager_LookupFace(fontRenderClass::instance->cacheManager,
                                    current_font->scaler.face_id,
                                    &current_face) < 0) ||
@@ -536,17 +500,6 @@ int eTextPara::renderString(const char *string, int rflags)
                eDebug("FTC_Manager_Lookup_Size failed!");
                return -1;
        }
-#else
-       if (&current_font->font.font != cache_current_font)
-       {
-               if (FTC_Manager_Lookup_Size(fontRenderClass::instance->cacheManager, &current_font->font.font, &current_face, &current_font->size)<0)
-               {
-                       eDebug("FTC_Manager_Lookup_Size failed!");
-                       return -1;
-               }
-               cache_current_font=&current_font->font.font;
-       }
-#endif
 
        if (!current_face)
                eFatal("eTextPara::renderString: no current_face");
@@ -610,7 +563,6 @@ int eTextPara::renderString(const char *string, int rflags)
        
                // now do the usual logical->visual reordering
        int size=uc_shape.size();
-#ifdef HAVE_FRIBIDI
        FriBidiCharType dir=FRIBIDI_TYPE_ON;
        uc_visual.resize(size);
        // gaaanz lahm, aber anders geht das leider nicht, sorry.
@@ -618,9 +570,6 @@ int eTextPara::renderString(const char *string, int rflags)
        std::copy(uc_shape.begin(), uc_shape.end(), array);
        fribidi_log2vis(array, size, &dir, target, 0, 0, 0);
        uc_visual.assign(target, target+size);
-#else
-       uc_visual=uc_shape;
-#endif
 
        glyphs.reserve(size);
        
@@ -714,13 +663,11 @@ nprint:   isprintable=0;
        }
        bboxValid=false;
        calc_bbox();
-#ifdef HAVE_FRIBIDI
        if (dir & FRIBIDI_MASK_RTL)
        {
                realign(dirRight);
                doTopBottomReordering=true;
        }
-#endif
 
        if (charCount)
        {
@@ -739,7 +686,6 @@ void eTextPara::blit(gDC &dc, const ePoint &offset, const gRGB &background, cons
        if (!current_font)
                return;
 
-#ifdef HAVE_FREETYPE2
        if ((FTC_Manager_LookupFace(fontRenderClass::instance->cacheManager,
                                    current_font->scaler.face_id,
                                    &current_face) < 0) ||
@@ -750,17 +696,6 @@ void eTextPara::blit(gDC &dc, const ePoint &offset, const gRGB &background, cons
                eDebug("FTC_Manager_Lookup_Size failed!");
                return;
        }
-#else
-       if (&current_font->font.font != cache_current_font)
-       {
-               if (FTC_Manager_Lookup_Size(fontRenderClass::instance->cacheManager, &current_font->font.font, &current_face, &current_font->size)<0)
-               {
-                       eDebug("FTC_Manager_Lookup_Size failed!");
-                       return;
-               }
-               cache_current_font=&current_font->font.font;
-       }
-#endif
 
        ePtr<gPixmap> target;
        dc.getPixmap(target);
index 7dd9f89..6b82183 100644 (file)
@@ -8,11 +8,9 @@
 #include FT_CACHE_H
 #include FT_CACHE_IMAGE_H
 #include FT_CACHE_SMALL_BITMAPS_H
-#ifdef HAVE_FREETYPE2
 typedef FTC_ImageCache FTC_Image_Cache;
 typedef FTC_ImageTypeRec FTC_Image_Desc;
 typedef FTC_SBitCache FTC_SBit_Cache;
-#endif
 #include <vector>
 #include <list>
 
@@ -191,9 +189,7 @@ class Font: public iObject
 {
        DECLARE_REF(Font);
 public:
-#ifdef HAVE_FREETYPE2
        FTC_ScalerRec scaler;
-#endif
        FTC_Image_Desc font;
        fontRenderClass *renderer;
        FT_Error getGlyphBitmap(FT_ULong glyph_index, FTC_SBit *sbit);
index 80dd247..a4f65eb 100644 (file)
@@ -7,18 +7,8 @@
 
 #include <time.h>
 
-gFBDC *gFBDC::instance;
-
-ePtr<gFBDC> NewgFBDCPtr(void)
-{
-       ePtr<gFBDC> ptr;
-       gFBDC::getInstance(ptr);
-       return ptr;
-}
-
 gFBDC::gFBDC()
 {
-       instance=this;
        fb=new fbClass;
 
        if (!fb->Available())
@@ -34,7 +24,6 @@ gFBDC::~gFBDC()
 {
        delete fb;
        delete[] surface.clut.data;
-       instance=0;
 }
 
 void gFBDC::calcRamp()
@@ -91,7 +80,7 @@ void gFBDC::setPalette()
        fb->PutCMAP();
 }
 
-void gFBDC::exec(gOpcode *o)
+void gFBDC::exec(const gOpcode *o)
 {
        switch (o->opcode)
        {
@@ -242,7 +231,4 @@ void gFBDC::reloadSettings()
        setPalette();
 }
 
-// eAutoInitPtr<gFBDC> init_gFBDC(eAutoInitNumbers::graphic-1, "GFBDC");
-#ifndef WITH_SDL
 eAutoInitPtr<gFBDC> init_gFBDC(eAutoInitNumbers::graphic-1, "GFBDC");
-#endif
index 23051c4..7f76d0c 100644 (file)
@@ -3,17 +3,12 @@
 
 #include "fb.h"
 #include "gpixmap.h"
-#include "grc.h"
+#include "gmaindc.h"
 
-class gFBDC;
-
-SWIG_IGNORE(gFBDC);
-class gFBDC: public gDC
+class gFBDC: public gMainDC
 {
-#ifndef SWIG
        fbClass *fb;
-       static gFBDC *instance;
-       void exec(gOpcode *opcode);
+       void exec(const gOpcode *opcode);
        unsigned char ramp[256], rampalpha[256]; // RGB ramp 0..255
        int brightness, gamma, alpha;
        void calcRamp();
@@ -21,13 +16,8 @@ class gFBDC: public gDC
        gSurface surface, surface_back;
        int m_enable_double_buffering;
        int m_xres, m_yres;
-#else
-       gFBDC();
-       virtual ~gFBDC();
-#endif
 public:
        void setResolution(int xres, int yres);
-#ifndef SWIG
        void reloadSettings();
        void setAlpha(int alpha);
        void setBrightness(int brightness);
@@ -43,17 +33,7 @@ public:
 
        gFBDC();
        virtual ~gFBDC();
-       static int getInstance(ePtr<gFBDC> &ptr) { if (!instance) return -1; ptr = instance; return 0; }
        int islocked() { return fb->islocked(); }
-#endif
 };
-SWIG_TEMPLATE_TYPEDEF(ePtr<gFBDC>, gFBDC);
-SWIG_EXTEND(ePtr<gFBDC>,
-       static ePtr<gFBDC> getInstance()
-       {
-               extern ePtr<gFBDC> NewgFBDCPtr(void);
-               return NewgFBDCPtr();
-       }
-);
 
 #endif
index a593cfa..bade53b 100644 (file)
@@ -30,7 +30,7 @@ gLCDDC::~gLCDDC()
        instance=0;
 }
 
-void gLCDDC::exec(gOpcode *o)
+void gLCDDC::exec(const gOpcode *o)
 {
        switch (o->opcode)
        {
index 6d5f383..a2b3c7f 100644 (file)
@@ -9,7 +9,7 @@ class gLCDDC: public gDC
        eLCD *lcd;
        static gLCDDC *instance;
        int update;
-       void exec(gOpcode *opcode);
+       void exec(const gOpcode *opcode);
        gSurface surface;
 public:
        gLCDDC();
diff --git a/lib/gdi/gmaindc.cpp b/lib/gdi/gmaindc.cpp
new file mode 100644 (file)
index 0000000..4890027
--- /dev/null
@@ -0,0 +1,28 @@
+#include <lib/gdi/gmaindc.h>
+
+gMainDC *gMainDC::m_instance;
+
+ePtr<gMainDC> NewgMainDCPtr(void)
+{
+       ePtr<gMainDC> ptr;
+       gMainDC::getInstance(ptr);
+       return ptr;
+}
+
+gMainDC::gMainDC()
+{
+       ASSERT(m_instance == 0);
+       m_instance = this;
+}
+
+gMainDC::gMainDC(gPixmap *pixmap) : gDC(pixmap)
+{
+       ASSERT(m_instance == 0);
+       m_instance = this;
+}
+
+gMainDC::~gMainDC()
+{
+       m_instance = 0;
+}
+
diff --git a/lib/gdi/gmaindc.h b/lib/gdi/gmaindc.h
new file mode 100644 (file)
index 0000000..780be2e
--- /dev/null
@@ -0,0 +1,33 @@
+#ifndef __lib_gdi_gmaindc_h
+#define __lib_gdi_gmaindc_h
+
+#include "grc.h"
+
+class gMainDC;
+
+SWIG_IGNORE(gMainDC);
+class gMainDC: public gDC
+{
+protected:
+       static gMainDC *m_instance;
+
+       gMainDC();
+       gMainDC(gPixmap *pixmap);
+       virtual ~gMainDC();
+public:
+       virtual void setResolution(int xres, int yres) = 0;
+#ifndef SWIG
+       static int getInstance(ePtr<gMainDC> &ptr) { if (!m_instance) return -1; ptr = m_instance; return 0; }
+#endif
+};
+
+SWIG_TEMPLATE_TYPEDEF(ePtr<gMainDC>, gMainDC);
+SWIG_EXTEND(ePtr<gMainDC>,
+       static ePtr<gMainDC> getInstance()
+       {
+               extern ePtr<gMainDC> NewgMainDCPtr(void);
+               return NewgMainDCPtr();
+       }
+);
+
+#endif
index dff6b05..a45b3b1 100644 (file)
@@ -609,7 +609,7 @@ gDC::~gDC()
        delete[] m_spinner_pic;
 }
 
-void gDC::exec(gOpcode *o)
+void gDC::exec(const gOpcode *o)
 {
        switch (o->opcode)
        {
index 3b8201a..38caa10 100644 (file)
@@ -286,7 +286,7 @@ protected:
        eRect m_spinner_pos;
        int m_spinner_num, m_spinner_i;
 public:
-       virtual void exec(gOpcode *opcode);
+       virtual void exec(const gOpcode *opcode);
        gDC(gPixmap *pixmap);
        gDC();
        virtual ~gDC();
@@ -296,10 +296,10 @@ public:
        virtual eSize size() { return m_pixmap->size(); }
        virtual int islocked() { return 0; }
        
-       void enableSpinner();
-       void disableSpinner();
-       void incrementSpinner();
-       void setSpinner(eRect pos, ePtr<gPixmap> *pic, int len);
+       virtual void enableSpinner();
+       virtual void disableSpinner();
+       virtual void incrementSpinner();
+       virtual void setSpinner(eRect pos, ePtr<gPixmap> *pic, int len);
 };
 
 #endif
index a7dc22d..518ee1b 100644 (file)
@@ -4,8 +4,12 @@
 #include <fcntl.h>
 #include <sys/ioctl.h>
 
+#if defined(HAVE_DBOX_FP_H) && defined(HAVE_DBOX_LCD_KS0713_H)
 #include <dbox/fp.h>
 #include <dbox/lcd-ks0713.h>
+#else
+#define NO_LCD 1
+#endif
 
 #include <lib/gdi/esize.h>
 #include <lib/base/init.h>
@@ -70,10 +74,6 @@ eDBoxLCD::eDBoxLCD()
                eDebug("found OLED display!");
                is_oled = 1;
        }
-#else
-       lcdfd = -1;
-#endif
-       instance=this;
 
        if (lcdfd<0)
                eDebug("couldn't open LCD - load lcd.o!");
@@ -106,6 +106,9 @@ eDBoxLCD::eDBoxLCD()
                        is_oled = 3;
                }
        }
+#endif
+       instance=this;
+
        setSize(xres, yres, bpp);
 }
 
@@ -117,6 +120,7 @@ void eDBoxLCD::setInverted(unsigned char inv)
 
 int eDBoxLCD::setLCDContrast(int contrast)
 {
+#ifndef NO_LCD
        int fp;
        if((fp=open("/dev/dbox/fp0", O_RDWR))<=0)
        {
@@ -129,11 +133,13 @@ int eDBoxLCD::setLCDContrast(int contrast)
                eDebug("[LCD] can't set lcd contrast");
        }
        close(fp);
+#endif
        return(0);
 }
 
 int eDBoxLCD::setLCDBrightness(int brightness)
 {
+#ifndef NO_LCD
        eDebug("setLCDBrightness %d", brightness);
        FILE *f=fopen("/proc/stb/lcd/oled_brightness", "w");
        if (!f)
@@ -157,6 +163,7 @@ int eDBoxLCD::setLCDBrightness(int brightness)
                        eDebug("[LCD] can't set lcd brightness (%m)");
                close(fp);
        }
+#endif
        return(0);
 }
 
index c162f89..0ce10c0 100644 (file)
@@ -1,4 +1,5 @@
-#include <png.h>       // must be included before Python.h because of setjmp
+#define PNG_SKIP_SETJMP_CHECK
+#include <png.h>
 #include <fcntl.h>
 
 #include <lib/gdi/picload.h>
index 6dbdb67..eb4e2ae 100644 (file)
@@ -1,80 +1,83 @@
-#ifdef WITH_SDL
 #include <lib/gdi/sdl.h>
-
+#include <lib/actions/action.h>
 #include <lib/base/init.h>
 #include <lib/base/init_num.h>
+#include <lib/driver/input_fake.h>
+#include <lib/driver/rcsdl.h>
 
 #include <SDL.h>
 
-gSDLDC *gSDLDC::m_instance;
-
-gSDLDC::gSDLDC()
+gSDLDC::gSDLDC() : m_pump(eApp, 1)
 {
-       if (SDL_Init(SDL_INIT_VIDEO) < 0)
-       {
+       if (SDL_Init(SDL_INIT_VIDEO) < 0) {
                eWarning("Could not initialize SDL: %s", SDL_GetError());
                return;
        }
-       
-       m_screen = SDL_SetVideoMode(720, 576, 32, SDL_HWSURFACE);
-       if (!m_screen)
-       {
-               eWarning("Could not create SDL surface: %s", SDL_GetError());
-               return;
-       }
 
-       m_instance=this;
-       
+       setResolution(720, 576);
+
+       CONNECT(m_pump.recv_msg, gSDLDC::pumpEvent);
+
        m_surface.type = 0;
-       m_surface.x = m_screen->w;
-       m_surface.y = m_screen->h;
-       m_surface.bpp = m_screen->format->BitsPerPixel;
-       m_surface.bypp = m_screen->format->BytesPerPixel;
-       m_surface.stride = m_screen->pitch;
-       m_surface.data = m_screen->pixels;
-       m_surface.clut.colors=256;
-       m_surface.clut.data=new gRGB[m_surface.clut.colors];
-       
+       m_surface.clut.colors = 256;
+       m_surface.clut.data = new gRGB[m_surface.clut.colors];
+
        m_pixmap = new gPixmap(&m_surface);
-       
+
        memset(m_surface.clut.data, 0, sizeof(*m_surface.clut.data)*m_surface.clut.colors);
+
+       run();
 }
 
 gSDLDC::~gSDLDC()
 {
+       pushEvent(EV_QUIT);
+       kill();
        SDL_Quit();
-       m_instance=0;
 }
 
-void gSDLDC::setPalette()
+void gSDLDC::keyEvent(const SDL_Event &event)
 {
-       if (!m_surface.clut.data)
-               return;
-       
-/*     for (int i=0; i<256; ++i)
-       {
-               fb->CMAP()->red[i]=ramp[m_surface.clut.data[i].r]<<8;
-               fb->CMAP()->green[i]=ramp[m_surface.clut.data[i].g]<<8;
-               fb->CMAP()->blue[i]=ramp[m_surface.clut.data[i].b]<<8;
-               fb->CMAP()->transp[i]=rampalpha[m_surface.clut.data[i].a]<<8;
-               if (!fb->CMAP()->red[i])
-                       fb->CMAP()->red[i]=0x100;
-       }
-       fb->PutCMAP(); */
+       eSDLInputDriver *driver = eSDLInputDriver::getInstance();
+
+       eDebug("SDL Key %s: key=%d", (event.type == SDL_KEYDOWN) ? "Down" : "Up", event.key.keysym.sym);
+
+       if (driver)
+               driver->keyPressed(&event.key);
 }
 
-void gSDLDC::exec(gOpcode *o)
+void gSDLDC::pumpEvent(const SDL_Event &event)
 {
-       switch (o->opcode)
-       {
-       case gOpcode::setPalette:
-       {
-               gDC::exec(o);
-               setPalette();
+       switch (event.type) {
+       case SDL_KEYDOWN:
+       case SDL_KEYUP:
+               keyEvent(event);
+               break;
+       case SDL_QUIT:
+               eDebug("SDL Quit");
+               extern void quitMainloop(int exit_code);
+               quitMainloop(0);
                break;
        }
+}
+
+void gSDLDC::pushEvent(enum event code, void *data1, void *data2)
+{
+       SDL_Event event;
+
+       event.type = SDL_USEREVENT;
+       event.user.code = code;
+       event.user.data1 = data1;
+       event.user.data2 = data2;
+
+       SDL_PushEvent(&event);
+}
+
+void gSDLDC::exec(const gOpcode *o)
+{
+       switch (o->opcode) {
        case gOpcode::flush:
-               SDL_Flip(m_screen);
+               pushEvent(EV_FLIP);
                eDebug("FLUSH");
                break;
        default:
@@ -83,6 +86,68 @@ void gSDLDC::exec(gOpcode *o)
        }
 }
 
-eAutoInitPtr<gSDLDC> init_gSDLDC(eAutoInitNumbers::graphic-1, "gSDLDC");
+void gSDLDC::setResolution(int xres, int yres)
+{
+       pushEvent(EV_SET_VIDEO_MODE, (void *)xres, (void *)yres);
+}
+
+/*
+ * SDL thread below...
+ */
+
+void gSDLDC::evSetVideoMode(unsigned long xres, unsigned long yres)
+{
+       m_screen = SDL_SetVideoMode(xres, yres, 32, SDL_HWSURFACE);
+       if (!m_screen) {
+               eFatal("Could not create SDL surface: %s", SDL_GetError());
+               return;
+       }
 
-#endif
+       m_surface.x = m_screen->w;
+       m_surface.y = m_screen->h;
+       m_surface.bpp = m_screen->format->BitsPerPixel;
+       m_surface.bypp = m_screen->format->BytesPerPixel;
+       m_surface.stride = m_screen->pitch;
+       m_surface.data = m_screen->pixels;
+
+       SDL_EnableUNICODE(1);
+}
+
+void gSDLDC::evFlip()
+{
+       SDL_Flip(m_screen);
+}
+
+void gSDLDC::thread()
+{
+       hasStarted();
+
+       bool stop = false;
+       while (!stop) {
+               SDL_Event event;
+               if (SDL_WaitEvent(&event)) {
+                       switch (event.type) {
+                       case SDL_KEYDOWN:
+                       case SDL_KEYUP:
+                       case SDL_QUIT:
+                               m_pump.send(event);
+                               break;
+                       case SDL_USEREVENT:
+                               switch (event.user.code) {
+                               case EV_SET_VIDEO_MODE:
+                                       evSetVideoMode((unsigned long)event.user.data1, (unsigned long)event.user.data2);
+                                       break;
+                               case EV_FLIP:
+                                       evFlip();
+                                       break;
+                               case EV_QUIT:
+                                       stop = true;
+                                       break;
+                               }
+                               break;
+                       }
+               }
+       }
+}
+
+eAutoInitPtr<gSDLDC> init_gSDLDC(eAutoInitNumbers::graphic-1, "gSDLDC");
index 20ff04f..6d016cf 100644 (file)
@@ -1,27 +1,39 @@
 #ifndef __lib_gdi_sdl_h
 #define __lib_gdi_sdl_h
 
-#include "fb.h"
-#include "gpixmap.h"
-#include "grc.h"
+#include <lib/base/thread.h>
+#include <lib/gdi/gmaindc.h>
 
 #include <SDL.h>
 
-class gSDLDC: public gDC
+class gSDLDC: public gMainDC, public eThread, public Object
 {
+private:
        SDL_Surface *m_screen;
-       static gSDLDC *m_instance;
-       void exec(gOpcode *opcode);
+       void exec(const gOpcode *opcode);
 
-       void setPalette();
        gSurface m_surface;
+
+       eFixedMessagePump<SDL_Event> m_pump;
+       void keyEvent(const SDL_Event &event);
+       void pumpEvent(const SDL_Event &event);
+       virtual void thread();
+
+       enum event {
+               EV_SET_VIDEO_MODE,
+               EV_FLIP,
+               EV_QUIT,
+       };
+
+       void pushEvent(enum event code, void *data1 = 0, void *data2 = 0);
+       void evSetVideoMode(unsigned long xres, unsigned long yres);
+       void evFlip();
+
 public:
-       
+       void setResolution(int xres, int yres);
        gSDLDC();
        virtual ~gSDLDC();
-       static int getInstance(ePtr<gSDLDC> &ptr) { if (!m_instance) return -1; ptr = m_instance; return 0; }
        int islocked() { return 0; }
 };
 
-
 #endif
index f4de9d1..9d31bf7 100644 (file)
@@ -1,11 +1,50 @@
-INCLUDES = \
+AM_CPPFLAGS = \
+       -I$(top_srcdir) \
        -I$(top_srcdir)/include \
-       -I$(top_srcdir)/src
+       -include Python.h \
+       -include $(top_builddir)/enigma2_config.h
 
 noinst_LIBRARIES = libenigma_gui.a
 
 libenigma_gui_a_SOURCES = \
-       ebutton.cpp elabel.cpp eslider.cpp ewidget.cpp ewidgetdesktop.cpp  \
-       ewindow.cpp ewindowstyle.cpp elistbox.cpp elistboxcontent.cpp \
-       epixmap.cpp ewindowstyleskinned.cpp einput.cpp einputstring.cpp einputnumber.cpp \
-       ewidgetanimation.cpp epositiongauge.cpp evideo.cpp esubtitle.cpp ecanvas.cpp
+       ebutton.cpp \
+       ecanvas.cpp \
+       einput.cpp \
+       einputnumber.cpp \
+       einputstring.cpp \
+       elabel.cpp \
+       elistbox.cpp \
+       elistboxcontent.cpp \
+       epixmap.cpp \
+       epositiongauge.cpp \
+       eslider.cpp \
+       esubtitle.cpp \
+       evideo.cpp \
+       ewidget.cpp \
+       ewidgetanimation.cpp \
+       ewidgetdesktop.cpp \
+       ewindow.cpp \
+       ewindowstyle.cpp \
+       ewindowstyleskinned.cpp
+
+guiincludedir = $(pkgincludedir)/lib/gui
+guiinclude_HEADERS = \
+       ebutton.h \
+       ecanvas.h \
+       einput.h \
+       einputnumber.h \
+       einputstring.h \
+       elabel.h \
+       elistbox.h \
+       elistboxcontent.h \
+       epixmap.h \
+       epositiongauge.h \
+       eslider.h \
+       esubtitle.h \
+       evideo.h \
+       ewidget.h \
+       ewidgetanimation.h \
+       ewidgetdesktop.h \
+       ewindow.h \
+       ewindowstyle.h \
+       ewindowstyleskinned.h
index 97e2cc6..ba0794e 100644 (file)
@@ -501,6 +501,7 @@ eListboxPythonMultiContent::~eListboxPythonMultiContent()
 {
        Py_XDECREF(m_buildFunc);
        Py_XDECREF(m_selectableFunc);
+       Py_XDECREF(m_template);
 }
 
 void eListboxPythonMultiContent::setSelectionClip(eRect &rect, bool update)
@@ -640,7 +641,8 @@ static ePyObject lookupColor(ePyObject color, ePyObject data)
        if ((icolor & 0xFF000000) == 0xFF000000)
        {
                int index = icolor & 0xFFFFFF;
-               eDebug("[eListboxPythonMultiContent] template color index: %d", index);
+               if (PyTuple_GetItem(data, index) == Py_None)
+                       return ePyObject();
                return PyTuple_GetItem(data, index);
        }
 
@@ -1158,5 +1160,7 @@ void eListboxPythonMultiContent::entryRemoved(int idx)
 
 void eListboxPythonMultiContent::setTemplate(ePyObject tmplate)
 {
+       Py_XDECREF(m_template);
        m_template = tmplate;
+       Py_XINCREF(m_template);
 }
index ff98c08..e45d4a6 100644 (file)
@@ -112,6 +112,7 @@ int ePositionGauge::event(int event, void *data, void *data2)
 //             painter.fill(eRect(0, 10, s.width(), s.height()-20));
                
                pts_t in = 0, out = 0;
+               int xm, xm_last = -1;
                
                std::multiset<cueEntry>::iterator i(m_cue_entries.begin());
                
@@ -126,17 +127,22 @@ int ePositionGauge::event(int event, void *data, void *data2)
                                        continue;
                                } else if (i->what == 1) /* out */
                                        out = i++->where;
-                               else if (i->what == 2) /* mark */
+                               else /* mark or last */
                                {
-                                       int xm = scale(i->where);
-                                       painter.setForegroundColor(gRGB(0xFF8080));
-                                       painter.fill(eRect(xm - 2, 0, 4, s.height()));
+                                       xm = scale(i->where);
+                                       if (i->what == 2) {
+                                               painter.setForegroundColor(gRGB(0xFF8080));
+                                               if (xm - 2 < xm_last) /* Make sure last is not overdrawn */
+                                                       painter.fill(eRect(xm_last, 0, 2 + xm - xm_last, s.height()));
+                                               else
+                                                       painter.fill(eRect(xm - 2, 0, 4, s.height()));
+                                       } else if (i->what == 3) {
+                                               painter.setForegroundColor(gRGB(0x80FF80));
+                                               painter.fill(eRect(xm - 1, 0, 3, s.height()));
+                                               xm_last = xm + 2;
+                                       }
                                        i++;
                                        continue;
-                               } else /* other marker, like last position */
-                               {
-                                       ++i;
-                                       continue;
                                }
                        }
                        
index 45345db..cdad728 100644 (file)
@@ -23,15 +23,21 @@ struct ePangoSubtitlePageElement
 
 struct ePangoSubtitlePage
 {
-       pts_t show_pts;
+       pts_t m_show_pts;
        int m_timeout; /* in milliseconds */
        std::vector<ePangoSubtitlePageElement> m_elements;
        void clear() { m_elements.clear(); }
 };
 
+struct eVobSubtitlePage
+{
+       pts_t m_show_pts;
+       int m_timeout; /* in milliseconds */
+       ePtr<gPixmap> m_pixmap;
+};
+
 class eDVBTeletextSubtitlePage;
-class eDVBPangoSubtitlePage;
-class ePangoSubtitlePage;
+class eDVBSubtitlePage;
 
 class eSubtitleWidget: public eWidget, public Object
 {
index 98bc1f7..08bd047 100644 (file)
@@ -381,7 +381,10 @@ void eWidgetDesktop::makeCompatiblePixmap(gPixmap &pm)
        ePtr<gPixmap> target_pixmap;
        m_screen.m_dc->getPixmap(target_pixmap);
        
-       ASSERT(target_pixmap);
+       if (!target_pixmap) {
+               eDebug("no target pixmap! assuming bpp > 8 for accelerated graphics.");
+               return;
+       }
        
        if (target_pixmap->surface && target_pixmap->surface->bpp > 8)
                return;
index 020c988..392c52c 100644 (file)
@@ -1,6 +1,14 @@
-INCLUDES = \
-       -I$(top_srcdir)/include
+AM_CPPFLAGS = \
+       -I$(top_srcdir) \
+       -I$(top_srcdir)/include \
+       -include Python.h \
+       -include $(top_builddir)/enigma2_config.h
 
 noinst_LIBRARIES = libenigma_mmi.a
 
-libenigma_mmi_a_SOURCES = mmi_ui.cpp
+libenigma_mmi_a_SOURCES = \
+       mmi_ui.cpp
+
+mmiincludedir = $(pkgincludedir)/lib/mmi
+mmiinclude_HEADERS = \
+       mmi_ui.h
index 0320cb2..3d57d6a 100644 (file)
@@ -1,9 +1,16 @@
-INCLUDES = \
-       -I$(top_srcdir)/include
+AM_CPPFLAGS = \
+       -I$(top_srcdir) \
+       -I$(top_srcdir)/include \
+       -include Python.h \
+       -include $(top_builddir)/enigma2_config.h
 
 noinst_LIBRARIES = libenigma_nav.a
 
 libenigma_nav_a_SOURCES = \
-       core.cpp pcore.cpp
-
+       core.cpp \
+       pcore.cpp
 
+navincludedir = $(pkgincludedir)/lib/nav
+navinclude_HEADERS = \
+       core.h \
+       pcore.h
diff --git a/lib/python/.gitignore b/lib/python/.gitignore
new file mode 100644 (file)
index 0000000..c1fa59f
--- /dev/null
@@ -0,0 +1,2 @@
+enigma.py
+enigma_python.cpp
old mode 100755 (executable)
new mode 100644 (file)
index e8e612a..30a7b60
@@ -5,23 +5,27 @@ from SystemInfo import SystemInfo
 import time
 from Components.Console import Console
 
+def MajorMinor(path):
+       rdev = stat(path).st_rdev
+       return (major(rdev),minor(rdev))
+
 def readFile(filename):
        file = open(filename)
        data = file.read().strip()
        file.close()
        return data
 
-class Harddisk:
-       DEVTYPE_UDEV = 0
-       DEVTYPE_DEVFS = 1
+DEVTYPE_UDEV = 0
+DEVTYPE_DEVFS = 1
 
+class Harddisk:
        def __init__(self, device):
                self.device = device
 
                if access("/dev/.udev", 0):
-                       self.type = self.DEVTYPE_UDEV
+                       self.type = DEVTYPE_UDEV
                elif access("/dev/.devfsd", 0):
-                       self.type = self.DEVTYPE_DEVFS
+                       self.type = DEVTYPE_DEVFS
                else:
                        print "Unable to determine structure of /dev"
 
@@ -33,11 +37,11 @@ class Harddisk:
                self.disk_path = ''
                self.phys_path = path.realpath(self.sysfsPath('device'))
 
-               if self.type == self.DEVTYPE_UDEV:
+               if self.type == DEVTYPE_UDEV:
                        self.dev_path = '/dev/' + self.device
                        self.disk_path = self.dev_path
 
-               elif self.type == self.DEVTYPE_DEVFS:
+               elif self.type == DEVTYPE_DEVFS:
                        tmp = readFile(self.sysfsPath('dev')).split(':')
                        s_major = int(tmp[0])
                        s_minor = int(tmp[1])
@@ -60,9 +64,9 @@ class Harddisk:
                return self.device < ob.device
 
        def partitionPath(self, n):
-               if self.type == self.DEVTYPE_UDEV:
+               if self.type == DEVTYPE_UDEV:
                        return self.dev_path + n
-               elif self.type == self.DEVTYPE_DEVFS:
+               elif self.type == DEVTYPE_DEVFS:
                        return self.dev_path + '/part' + n
 
        def sysfsPath(self, filename):
@@ -75,9 +79,9 @@ class Harddisk:
 
        def bus(self):
                # CF (7025 specific)
-               if self.type == self.DEVTYPE_UDEV:
+               if self.type == DEVTYPE_UDEV:
                        ide_cf = False  # FIXME
-               elif self.type == self.DEVTYPE_DEVFS:
+               elif self.type == DEVTYPE_DEVFS:
                        ide_cf = self.device[:2] == "hd" and "host0" not in self.dev_path
 
                internal = "pci" in self.phys_path
@@ -125,18 +129,20 @@ class Harddisk:
 
                for line in lines:
                        parts = line.strip().split(" ")
-                       if path.realpath(parts[0]).startswith(self.dev_path):
-                               try:
+                       real_path = path.realpath(parts[0])
+                       if not real_path[-1].isdigit():
+                               continue
+                       try:
+                               if MajorMinor(real_path) == MajorMinor(self.partitionPath(real_path[-1])):
                                        stat = statvfs(parts[1])
-                               except OSError:
-                                       continue
-                               return stat.f_bfree/1000 * stat.f_bsize/1000
-
+                                       return stat.f_bfree/1000 * stat.f_bsize/1000
+                       except OSError:
+                               pass
                return -1
 
        def numPartitions(self):
                numPart = -1
-               if self.type == self.DEVTYPE_UDEV:
+               if self.type == DEVTYPE_UDEV:
                        try:
                                devdir = listdir('/dev')
                        except OSError:
@@ -145,7 +151,7 @@ class Harddisk:
                                if filename.startswith(self.device):
                                        numPart += 1
 
-               elif self.type == self.DEVTYPE_DEVFS:
+               elif self.type == DEVTYPE_DEVFS:
                        try:
                                idedir = listdir(self.dev_path)
                        except OSError:
@@ -168,16 +174,23 @@ class Harddisk:
 
                cmd = "umount"
 
-               for line in lines:
-                       parts = line.strip().split(" ")
-                       if path.realpath(parts[0]).startswith(self.dev_path):
-                               cmd = ' ' . join([cmd, parts[1]])
+                for line in lines:                                                                          
+                        parts = line.strip().split(" ")                                                     
+                        real_path = path.realpath(parts[0])                                                 
+                        if not real_path[-1].isdigit():                                                     
+                                continue                                                                    
+                        try:                                                                                
+                                if MajorMinor(real_path) == MajorMinor(self.partitionPath(real_path[-1])):
+                                       cmd = ' ' . join([cmd, parts[1]])
+                                       break
+                       except OSError:
+                               pass
 
                res = system(cmd)
                return (res >> 8)
 
        def createPartition(self):
-               cmd = 'printf "0,\n;\n;\n;\ny\n" | sfdisk -f ' + self.disk_path
+               cmd = 'printf "8,\n;0,0\n;0,0\n;0,0\ny\n" | sfdisk -f -uS ' + self.disk_path
                res = system(cmd)
                return (res >> 8)
 
@@ -201,10 +214,16 @@ class Harddisk:
                res = -1
                for line in lines:
                        parts = line.strip().split(" ")
-                       if path.realpath(parts[0]) == self.partitionPath("1"):
-                               cmd = "mount -t ext3 " + parts[0]
-                               res = system(cmd)
-                               break
+                        real_path = path.realpath(parts[0])                                                 
+                        if not real_path[-1].isdigit():                                                     
+                                continue                                                                    
+                        try:                                                                                
+                                if MajorMinor(real_path) == MajorMinor(self.partitionPath(real_path[-1])):
+                                       cmd = "mount -t ext3 " + parts[0]
+                                       res = system(cmd)
+                                       break
+                       except OSError:
+                               pass
 
                return (res >> 8)
 
@@ -394,24 +413,38 @@ class Partition:
                                return True
                return False
 
-DEVICEDB =  \
+DEVICEDB_SR = \
        {"dm8000":
                {
-                       # dm8000:
-                       "/devices/platform/brcm-ehci.0/usb1/1-1/1-1.1/1-1.1:1.0": "Front USB Slot",
-                       "/devices/platform/brcm-ehci.0/usb1/1-1/1-1.2/1-1.2:1.0": "Back, upper USB Slot",
-                       "/devices/platform/brcm-ehci.0/usb1/1-1/1-1.3/1-1.3:1.0": "Back, lower USB Slot",
-                       "/devices/platform/brcm-ehci-1.1/usb2/2-1/2-1:1.0/host1/target1:0:0/1:0:0:0": "DVD Drive",
+                       "/devices/pci0000:01/0000:01:00.0/host0/target0:0:0/0:0:0:0": _("DVD Drive"),
+                       "/devices/pci0000:01/0000:01:00.0/host1/target1:0:0/1:0:0:0": _("DVD Drive"),
+                       "/devices/platform/brcm-ehci-1.1/usb2/2-1/2-1:1.0/host3/target3:0:0/3:0:0:0": _("DVD Drive"),
+               },
+       "dm800":
+       {
+       },
+       "dm7025":
+       {
+       }
+       }
+
+DEVICEDB = \
+       {"dm8000":
+               {
+                       "/devices/platform/brcm-ehci.0/usb1/1-1/1-1.1/1-1.1:1.0": _("Front USB Slot"),
+                       "/devices/platform/brcm-ehci.0/usb1/1-1/1-1.2/1-1.2:1.0": _("Back, upper USB Slot"),
+                       "/devices/platform/brcm-ehci.0/usb1/1-1/1-1.3/1-1.3:1.0": _("Back, lower USB Slot"),
+                       "/devices/platform/brcm-ehci.0/usb1/1-1/1-1.1/1-1.1:1.0": _("Front USB Slot"),
+                       "/devices/platform/brcm-ehci-1.1/usb2/2-1/2-1:1.0/": _("Internal USB Slot"),
+                       "/devices/platform/brcm-ohci-1.1/usb4/4-1/4-1:1.0/": _("Internal USB Slot"),
                },
        "dm800":
        {
-               # dm800:
                "/devices/platform/brcm-ehci.0/usb1/1-2/1-2:1.0": "Upper USB Slot",
                "/devices/platform/brcm-ehci.0/usb1/1-1/1-1:1.0": "Lower USB Slot",
        },
        "dm7025":
        {
-               # dm7025:
                "/devices/pci0000:00/0000:00:14.1/ide1/1.0": "CF Card Slot", #hdc
                "/devices/pci0000:00/0000:00:14.1/ide0/0.0": "Internal Harddisk"
        }
@@ -422,6 +455,7 @@ class HarddiskManager:
                self.hdd = [ ]
                self.cd = ""
                self.partitions = [ ]
+               self.devices_scanned_on_init = [ ]
 
                self.on_partition_list_change = CList()
 
@@ -489,24 +523,23 @@ class HarddiskManager:
        def enumerateBlockDevices(self):
                print "enumerating block devices..."
                for blockdev in listdir("/sys/block"):
-                       error, blacklisted, removable, is_cdrom, partitions, medium_found = self.getBlockDevInfo(blockdev)
-                       print "found block device '%s':" % blockdev, 
-                       if error:
-                               print "error querying properties"
-                       elif blacklisted:
-                               print "blacklisted"
-                       elif not medium_found:
-                               print "no medium"
-                       else:
-                               print "ok, removable=%s, cdrom=%s, partitions=%s, device=%s" % (removable, is_cdrom, partitions, blockdev)
-
-                               self.addHotplugPartition(blockdev)
-                               for part in partitions:
-                                       self.addHotplugPartition(part)
+                       error, blacklisted, removable, is_cdrom, partitions, medium_found = self.addHotplugPartition(blockdev)
+                       if not error and not blacklisted:
+                               if medium_found:
+                                       for part in partitions:
+                                               self.addHotplugPartition(part)
+                               self.devices_scanned_on_init.append((blockdev, removable, is_cdrom, medium_found))
 
        def getAutofsMountpoint(self, device):
                return "/autofs/%s/" % (device)
 
+       def is_hard_mounted(self, device):
+               mounts = file('/proc/mounts').read().split('\n')
+               for x in mounts:
+                       if x.find('/autofs') == -1 and x.find(device) != -1:
+                               return True
+               return False
+
        def addHotplugPartition(self, device, physdev = None):
                if not physdev:
                        dev, part = self.splitDeviceName(device)
@@ -516,22 +549,36 @@ class HarddiskManager:
                                physdev = dev
                                print "couldn't determine blockdev physdev for device", device
 
-               # device is the device name, without /dev
-               # physdev is the physical device path, which we (might) use to determine the userfriendly name
-               description = self.getUserfriendlyDeviceName(device, physdev)
+               error, blacklisted, removable, is_cdrom, partitions, medium_found = self.getBlockDevInfo(device)
+               print "found block device '%s':" % device,
 
-               p = Partition(mountpoint = self.getAutofsMountpoint(device), description = description, force_mounted = True, device = device)
-               self.partitions.append(p)
-               self.on_partition_list_change("add", p)
+               if blacklisted:
+                       print "blacklisted"
+               else:
+                       if error:
+                               print "error querying properties"
+                       elif not medium_found:
+                               print "no medium"
+                       else:
+                               print "ok, removable=%s, cdrom=%s, partitions=%s" % (removable, is_cdrom, partitions)
+
+                       l = len(device)
+                       if l:
+                               # see if this is a harddrive
+                               if not device[l-1].isdigit() and not removable and not is_cdrom:
+                                       self.hdd.append(Harddisk(device))
+                                       self.hdd.sort()
+                                       SystemInfo["Harddisk"] = len(self.hdd) > 0
+
+                               if (not removable or medium_found) and not self.is_hard_mounted(device):
+                                       # device is the device name, without /dev
+                                       # physdev is the physical device path, which we (might) use to determine the userfriendly name
+                                       description = self.getUserfriendlyDeviceName(device, physdev)
+                                       p = Partition(mountpoint = self.getAutofsMountpoint(device), description = description, force_mounted = True, device = device)
+                                       self.partitions.append(p)
+                                       self.on_partition_list_change("add", p)
 
-               # see if this is a harddrive
-               l = len(device)
-               if l and not device[l-1].isdigit():
-                       error, blacklisted, removable, is_cdrom, partitions, medium_found = self.getBlockDevInfo(device)
-                       if not blacklisted and not removable and not is_cdrom and medium_found:
-                               self.hdd.append(Harddisk(device))
-                               self.hdd.sort()
-                               SystemInfo["Harddisk"] = len(self.hdd) > 0
+               return error, blacklisted, removable, is_cdrom, partitions, medium_found
 
        def removeHotplugPartition(self, device):
                mountpoint = self.getAutofsMountpoint(device)
@@ -589,15 +636,23 @@ class HarddiskManager:
        def getUserfriendlyDeviceName(self, dev, phys):
                dev, part = self.splitDeviceName(dev)
                description = "External Storage %s" % dev
+               have_model_descr = False
                try:
                        description = readFile("/sys" + phys + "/model")
+                       have_model_descr = True
                except IOError, s:
                        print "couldn't read model: ", s
                from Tools.HardwareInfo import HardwareInfo
-               for physdevprefix, pdescription in DEVICEDB.get(HardwareInfo().device_name,{}).items():
+               if dev.find('sr') == 0 and dev[2].isdigit():
+                       devicedb = DEVICEDB_SR
+               else:
+                       devicedb = DEVICEDB
+               for physdevprefix, pdescription in devicedb.get(HardwareInfo().device_name,{}).items():
                        if phys.startswith(physdevprefix):
-                               description = pdescription
-
+                               if have_model_descr:
+                                       description = pdescription + ' - ' + description
+                               else:
+                                       description = pdescription
                # not wholedisk and not partition 1
                if part and part != 1:
                        description += " (Partition %d)" % part
index 820d103..b026cd5 100755 (executable)
@@ -1,6 +1,7 @@
 from Components.Console import Console
 from os import listdir as os_listdir, path as os_path
 from re import compile as re_compile
+from enigma import eEnv
 
 class Keyboard:
        def __init__(self):
@@ -8,9 +9,9 @@ class Keyboard:
                self.readKeyboardMapFiles()
 
        def readKeyboardMapFiles(self):
-               for keymapfile in os_listdir('/usr/share/keymaps/'):
+               for keymapfile in os_listdir(eEnv.resolve('${datadir}/keymaps/')):
                        if (keymapfile.endswith(".info")):
-                               f = open('/usr/share/keymaps/' + keymapfile)
+                               f = open(eEnv.resolve('${datadir}/keymaps/') + keymapfile)
                                mapfile = None
                                mapname = None
                                for line in f:
@@ -32,7 +33,7 @@ class Keyboard:
                try:
                        keymap = self.keyboardmaps[index]
                        print "Activating keymap:",keymap[1]
-                       keymappath = '/usr/share/keymaps/' + keymap[0]
+                       keymappath = eEnv.resolve('${datadir}/keymaps/') + keymap[0]
                        if os_path.exists(keymappath):
                                Console().ePopen(("loadkmap < " + str(keymappath)))
                except:
index 7303186..7f7dd5c 100644 (file)
@@ -10,7 +10,7 @@ from enigma import eDVBSatelliteEquipmentControl as secClass, \
        eDVBSatelliteDiseqcParameters as diseqcParam, \
        eDVBSatelliteSwitchParameters as switchParam, \
        eDVBSatelliteRotorParameters as rotorParam, \
-       eDVBResourceManager, eDVBDB
+       eDVBResourceManager, eDVBDB, eEnv
 
 from time import localtime, mktime
 from datetime import datetime
@@ -390,6 +390,7 @@ class SecConfigure:
 
                                        if currLnb.diseqcMode.value == "1_0":
                                                currCO = currLnb.commandOrder1_0.value
+                                               sec.setRepeats(0)
                                        else:
                                                currCO = currLnb.commandOrder.value
 
@@ -1082,7 +1083,7 @@ def InitNimManager(nimmgr):
 
        unicablelnbproducts = {}
        unicablematrixproducts = {}
-       doc = xml.etree.cElementTree.parse("/usr/share/enigma2/unicable.xml")
+       doc = xml.etree.cElementTree.parse(eEnv.resolve("${datadir}/enigma2/unicable.xml"))
        root = doc.getroot()
 
        entry = root.find("lnb")
index 5ae43ed..51dc09a 100644 (file)
@@ -2,11 +2,11 @@
 ## Picon renderer by Gruffy .. some speedups by Ghost
 ##
 from Renderer import Renderer
-from enigma import ePixmap
+from enigma import ePixmap, eEnv
 from Tools.Directories import fileExists, SCOPE_SKIN_IMAGE, SCOPE_CURRENT_SKIN, resolveFilename
 
 class Picon(Renderer):
-       searchPaths = ('/usr/share/enigma2/%s/',
+       searchPaths = (eEnv.resolve('${datadir}/enigma2/%s/'),
                                '/media/cf/%s/',
                                '/media/usb/%s/')
 
index b472a19..b9dda6a 100644 (file)
@@ -2,6 +2,7 @@ import NavigationInstance
 from time import localtime, mktime, gmtime
 from ServiceReference import ServiceReference
 from enigma import iServiceInformation, eServiceCenter, eServiceReference
+from timer import TimerEntry
 
 class TimerSanityCheck:
        def __init__(self, timerlist, newtimer=None):
@@ -107,7 +108,7 @@ class TimerSanityCheck:
                                                        self.rep_eventlist.append((begin, idx))
                                                begin += 86400
                                                rflags >>= 1
-                               else:
+                               elif timer.state < TimerEntry.StateEnded:
                                        self.nrep_eventlist.extend([(timer.begin,self.bflag,idx),(timer.end,self.eflag,idx)])
                        idx += 1
 
index b86c1a1..a265a16 100644 (file)
@@ -1,7 +1,7 @@
 from Components.Harddisk import harddiskmanager
 from config import ConfigSubsection, ConfigYesNo, config, ConfigSelection, ConfigText, ConfigNumber, ConfigSet, ConfigLocations
 from Tools.Directories import resolveFilename, SCOPE_HDD
-from enigma import Misc_Options, setTunerTypePriorityOrder;
+from enigma import Misc_Options, setTunerTypePriorityOrder, eEnv;
 from SystemInfo import SystemInfo
 import os
 
@@ -94,7 +94,7 @@ def InitUsageConfig():
 
        SystemInfo["12V_Output"] = Misc_Options.getInstance().detected_12V_output()
 
-       config.usage.keymap = ConfigText(default = "/usr/share/enigma2/keymap.xml")
+       config.usage.keymap = ConfigText(default = eEnv.resolve("${datadir}/enigma2/keymap.xml"))
 
        config.seek = ConfigSubsection()
        config.seek.selfdefined_13 = ConfigNumber(default=15)
@@ -102,13 +102,11 @@ def InitUsageConfig():
        config.seek.selfdefined_79 = ConfigNumber(default=300)
 
        config.seek.speeds_forward = ConfigSet(default=[2, 4, 8, 16, 32, 64, 128], choices=[2, 4, 6, 8, 12, 16, 24, 32, 48, 64, 96, 128])
-       config.seek.speeds_backward = ConfigSet(default=[8, 16, 32, 64, 128], choices=[1, 2, 4, 6, 8, 12, 16, 24, 32, 48, 64, 96, 128])
+       config.seek.speeds_backward = ConfigSet(default=[2, 4, 8, 16, 32, 64, 128], choices=[1, 2, 4, 6, 8, 12, 16, 24, 32, 48, 64, 96, 128])
        config.seek.speeds_slowmotion = ConfigSet(default=[2, 4, 8], choices=[2, 4, 6, 8, 12, 16, 25])
 
        config.seek.enter_forward = ConfigSelection(default = "2", choices = ["2", "4", "6", "8", "12", "16", "24", "32", "48", "64", "96", "128"])
        config.seek.enter_backward = ConfigSelection(default = "1", choices = ["1", "2", "4", "6", "8", "12", "16", "24", "32", "48", "64", "96", "128"])
-       config.seek.stepwise_minspeed = ConfigSelection(default = "16", choices = ["Never", "2", "4", "6", "8", "12", "16", "24", "32", "48", "64", "96", "128"])
-       config.seek.stepwise_repeat = ConfigSelection(default = "3", choices = ["2", "3", "4", "5", "6"])
 
        config.seek.on_pause = ConfigSelection(default = "play", choices = [
                ("play", _("Play")),
index d7506e3..6e56085 100755 (executable)
@@ -1624,16 +1624,17 @@ class Config(ConfigSubsection):
                self.pickle_this("config", self.saved_value, result)
                return ''.join(result)
 
-       def unpickle(self, lines):
+       def unpickle(self, lines, base_file=True):
                tree = { }
                for l in lines:
                        if not l or l[0] == '#':
                                continue
 
                        n = l.find('=')
+                       name = l[:n]
                        val = l[n+1:].strip()
 
-                       names = l[:n].split('.')
+                       names = name.split('.')
 #                      if val.find(' ') != -1:
 #                              val = val[:val.find(' ')]
 
@@ -1644,6 +1645,15 @@ class Config(ConfigSubsection):
 
                        base[names[-1]] = val
 
+                       if not base_file: # not the initial config file..
+                               #update config.x.y.value when exist
+                               try:
+                                       configEntry = eval(name)
+                                       if configEntry is not None:
+                                               configEntry.value = val
+                               except (SyntaxError, KeyError):
+                                       pass
+
                # we inherit from ConfigSubsection, so ...
                #object.__setattr__(self, "saved_value", tree["config"])
                if "config" in tree:
@@ -1655,9 +1665,9 @@ class Config(ConfigSubsection):
                f.write(text)
                f.close()
 
-       def loadFromFile(self, filename):
+       def loadFromFile(self, filename, base_file=False):
                f = open(filename, "r")
-               self.unpickle(f.readlines())
+               self.unpickle(f.readlines(), base_file)
                f.close()
 
 config = Config()
@@ -1668,7 +1678,7 @@ class ConfigFile:
 
        def load(self):
                try:
-                       config.loadFromFile(self.CONFIG_FILE)
+                       config.loadFromFile(self.CONFIG_FILE, True)
                except IOError, e:
                        print "unable to load config (%s), assuming defaults..." % str(e)
 
index e38f7d8..666ba67 100644 (file)
@@ -1,23 +1,45 @@
-INCLUDES = \
+AM_CPPFLAGS = \
+       -I$(top_srcdir) \
        -I$(top_srcdir)/include \
-       -I$(top_srcdir)/src
+       -include Python.h \
+       -include $(top_builddir)/enigma2_config.h
 
 SUBDIRS = Components Tools Screens Plugins
 
 noinst_LIBRARIES = libenigma_python.a
 
 libenigma_python_a_SOURCES = \
-       python.cpp enigma_python_wrap.cxx connections.cpp
+       connections.cpp \
+       python.cpp
 
-enigma_python_wrap.cxx: enigma_python.i
-       swig -I$(top_srcdir)/ -c++ -python -O -nortti -nothreads enigma_python.i
-       python enigma_py_patcher.py
+pythonincludedir = $(pkgincludedir)/lib/python
+pythoninclude_HEADERS = \
+       connections.h \
+       python.h \
+       swig.h
 
-enigma.py: enigma_python_wrap.cxx
+nodist_libenigma_python_a_SOURCES = \
+       enigma_python.cpp
 
-CLEANFILES = enigma.py enigma_python_wrap.cxx
+noinst_PYTHON = \
+       enigma_py_patcher.py
+
+EXTRA_DIST = \
+       enigma_python.i
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/enigma_python.Pcpp@am__quote@
+
+.i.cpp:
+       $(AM_V_GEN)$(SWIG) $(AX_SWIG_PYTHON_OPT) -MT $@ -MD -MF $(DEPDIR)/$*.Tpo -I$(top_srcdir) -O -nortti -nothreads -o $@ $<
+       $(AM_V_at)mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Pcpp
+       $(AM_V_at)$(PYTHON) $(srcdir)/enigma_py_patcher.py
+
+enigma.py: enigma_python.cpp
+
+CLEANFILES = enigma.py enigma_python.cpp
 
 installdir = $(pkglibdir)/python
 
 install_PYTHON = \
        enigma.py
+
index 3ccca98..4828081 100644 (file)
@@ -1,4 +1,4 @@
-installdir = $(LIBDIR)/enigma2/python/Plugins/DemoPlugins/TPMDemo
+installdir = $(pkglibdir)/python/Plugins/DemoPlugins/TPMDemo
 
 install_PYTHON = \
        __init__.py \
index 7f755db..6dbcd49 100644 (file)
@@ -2,6 +2,7 @@ from Tools.Directories import fileExists
 from Components.config import config, ConfigSubsection, ConfigInteger, ConfigText, ConfigSelection, getConfigListEntry, ConfigSequence, ConfigSubList
 import DVDTitle
 import xml.dom.minidom
+from Tools.Directories import resolveFilename, SCOPE_PLUGINS, SCOPE_FONTS
 
 class ConfigColor(ConfigSequence):
        def __init__(self, default = [128,128,128]):
@@ -125,6 +126,14 @@ class DVDProject:
                        for key in self.filekeys:
                                val = self.settings.dict()[key].getValue()
                                if not fileExists(val):
+                                       if val[0] != "/":
+                                               if key.find("font") == 0:
+                                                       val = resolveFilename(SCOPE_FONTS)+val
+                                               else:
+                                                       val = resolveFilename(SCOPE_PLUGINS)+"Extensions/DVDBurn/"+val
+                                               if fileExists(val):
+                                                       self.settings.dict()[key].setValue(val)
+                                                       continue
                                        self.error += "\n%s '%s' not found" % (key, val)
                #except AttributeError:
                        #print "loadProject AttributeError", self.error
index 451e8a8..4645260 100644 (file)
@@ -3,11 +3,11 @@
        <settings
                name="Dreambox DVD record"
                authormode="menu_linked"
-               menutemplate="/usr/lib/enigma2/python/Plugins/Extensions/DVDBurn/Thumbs_menu_clouds.ddvdm.xml"
+               menutemplate="Thumbs_menu_clouds.ddvdm.xml"
                titlesetmode="multi"
-               vmgm="/usr/lib/enigma2/python/Plugins/Extensions/DVDBurn/vmgmdream.mpg"
+               vmgm="vmgmdream.mpg"
                output="dvd"
-               isopath="/media/hdd/movie/"
+               isopath="/hdd/movie/"
                dataformat="iso9660_4"
        />
        <titles> </titles>
index 0de7f4b..bf6356a 100644 (file)
@@ -3,17 +3,17 @@
        <settings
                titleformat="$i. $t"
                subtitleformat="$D.$M.$Y, $T $C, $d"
-               menubg="/usr/lib/enigma2/python/Plugins/Extensions/DVDBurn/dreamdvd_boat.jpg"
-               menuaudio="/usr/lib/enigma2/python/Plugins/Extensions/DVDBurn/silence.mp2"
+               menubg="dreamdvd_boat.jpg"
+               menuaudio="silence.mp2"
                dimensions="(720, 576)"
                rows="5"
                cols="1"
                color_button="[8, 0, 0]"
                color_highlight="[0, 192, 192]"
                color_headline="[0, 0, 128]"
-               fontface_headline="/usr/share/fonts/nmsbd.ttf"
-               fontface_title="/usr/share/fonts/nmsbd.ttf"
-               fontface_subtitle="/usr/share/fonts/nmsbd.ttf"
+               fontface_headline="nmsbd.ttf"
+               fontface_title="nmsbd.ttf"
+               fontface_subtitle="nmsbd.ttf"
                fontsize_headline="46"
                fontsize_title="24"
                fontsize_subtitle="14"
index c00c3fe..074f203 100644 (file)
@@ -3,17 +3,17 @@
        <settings
                titleformat="$t"
                subtitleformat="$d"
-               menubg="/usr/lib/enigma2/python/Plugins/Extensions/DVDBurn/dreamdvd_clouds.jpg"
-               menuaudio="/usr/lib/enigma2/python/Plugins/Extensions/DVDBurn/silence.mp2"
+               menubg="dreamdvd_clouds.jpg"
+               menuaudio="silence.mp2"
                dimensions="(720, 576)"
                rows="2"
                cols="2"
                color_button="[8, 0, 0]"
                color_highlight="[128, 0, 0]"
                color_headline="[128, 0, 0]"
-               fontface_headline="/usr/share/fonts/nmsbd.ttf"
-               fontface_title="/usr/share/fonts/nmsbd.ttf"
-               fontface_subtitle="/usr/share/fonts/nmsbd.ttf"
+               fontface_headline="nmsbd.ttf"
+               fontface_title="nmsbd.ttf"
+               fontface_subtitle="nmsbd.ttf"
                fontsize_headline="46"
                fontsize_title="18"
                fontsize_subtitle="12"
index 71ea714..ec212e4 100644 (file)
@@ -1,4 +1,3 @@
-if HAVE_DDVDLIB
 SUBDIRS = src meta
 
 installdir = $(pkglibdir)/python/Plugins/Extensions/DVDPlayer
@@ -8,4 +7,3 @@ install_PYTHON = \
        plugin.py \
        keymap.xml \
        LICENSE
-endif
index 64b4ae5..7f330eb 100755 (executable)
@@ -39,8 +39,11 @@ class FileBrowser(Screen):
                                currDir = "/media/dvd/"
                        if not pathExists(currDir):
                                currDir = "/"
+                       if lastpath == "":  # 'None' is magic to start at the list of mountpoints
+                               currDir = None
 
-                       self.filelist = FileList(currDir, matchingPattern = "(?i)^.*\.(iso)", useServiceRef = True)
+                       inhibitDirs = ["/bin", "/boot", "/dev", "/etc", "/home", "/lib", "/proc", "/sbin", "/share", "/sys", "/tmp", "/usr", "/var"]
+                       self.filelist = FileList(currDir, matchingPattern = "(?i)^.*\.(iso|img)", useServiceRef = True)
                        self["filelist"] = self.filelist
 
                self["FilelistActions"] = ActionMap(["SetupActions"],
@@ -79,6 +82,12 @@ class FileBrowser(Screen):
                                        lastpath = (pathname.rstrip("/").rsplit("/",1))[0]
                                        print "lastpath video_ts.ifo=", lastpath
                                        self.close(pathname)
+                               if fileExists(pathname+"VIDEO_TS/VIDEO_TS.IFO"):
+                                       print "dvd structure found, trying to open..."
+                                       lastpath = (pathname.rstrip("/").rsplit("/",1))[0]
+                                       print "lastpath video_ts.ifo=", lastpath
+                                       pathname += "VIDEO_TS"
+                                       self.close(pathname)
                        else:
                                lastpath = filename[0:filename.rfind("/")]
                                print "lastpath directory=", lastpath
@@ -235,8 +244,6 @@ class DVDPlayer(Screen, InfoBarBase, InfoBarNotifications, InfoBarSeek, InfoBarP
                self.saved_config_speeds_backward = config.seek.speeds_backward.value
                self.saved_config_enter_forward = config.seek.enter_forward.value
                self.saved_config_enter_backward = config.seek.enter_backward.value
-               self.saved_config_seek_stepwise_minspeed = config.seek.stepwise_minspeed.value
-               self.saved_config_seek_stepwise_repeat = config.seek.stepwise_repeat.value
                self.saved_config_seek_on_pause = config.seek.on_pause.value
                self.saved_config_seek_speeds_slowmotion = config.seek.speeds_slowmotion.value
 
@@ -246,8 +253,6 @@ class DVDPlayer(Screen, InfoBarBase, InfoBarNotifications, InfoBarSeek, InfoBarP
                config.seek.speeds_slowmotion.value = [ ]
                config.seek.enter_forward.value = "2"
                config.seek.enter_backward.value = "2"
-               config.seek.stepwise_minspeed.value = "Never"
-               config.seek.stepwise_repeat.value = "3"
                config.seek.on_pause.value = "play"
 
        def restore_infobar_seek_config(self):
@@ -256,8 +261,6 @@ class DVDPlayer(Screen, InfoBarBase, InfoBarNotifications, InfoBarSeek, InfoBarP
                config.seek.speeds_slowmotion.value = self.saved_config_seek_speeds_slowmotion
                config.seek.enter_forward.value = self.saved_config_enter_forward
                config.seek.enter_backward.value = self.saved_config_enter_backward
-               config.seek.stepwise_minspeed.value = self.saved_config_seek_stepwise_minspeed
-               config.seek.stepwise_repeat.value = self.saved_config_seek_stepwise_repeat
                config.seek.on_pause.value = self.saved_config_seek_on_pause
 
        def __init__(self, session, dvd_device = None, dvd_filelist = [ ], args = None):
@@ -269,7 +272,7 @@ class DVDPlayer(Screen, InfoBarBase, InfoBarNotifications, InfoBarSeek, InfoBarP
                HelpableScreen.__init__(self)
                self.save_infobar_seek_config()
                self.change_infobar_seek_config()
-               InfoBarSeek.__init__(self, useSeekBackHack=False)
+               InfoBarSeek.__init__(self)
                InfoBarPVRState.__init__(self)
                self.dvdScreen = self.session.instantiateDialog(DVDOverlay)
 
@@ -625,6 +628,14 @@ class DVDPlayer(Screen, InfoBarBase, InfoBarNotifications, InfoBarSeek, InfoBarP
                        newref = eServiceReference(4369, 0, val)
                        print "play", newref.toString()
                        if curref is None or curref != newref:
+                               if newref.toString().endswith("/VIDEO_TS") or newref.toString().endswith("/"):
+                                       names = newref.toString().rsplit("/",3)
+                                       if names[2].startswith("Disk ") or names[2].startswith("DVD "):
+                                               name = str(names[1]) + " - " + str(names[2])
+                                       else:
+                                               name = names[2]
+                                       print "setting name to: ", self.service
+                                       newref.setName(str(name))
                                self.session.nav.playService(newref)
                                self.service = self.session.nav.getCurrentService()
                                print "self.service", self.service
index 27c751c..3e2ee67 100644 (file)
@@ -1,17 +1,18 @@
-OBJS := servicedvd.cpp
+AM_CPPFLAGS = \
+       -I$(top_srcdir) \
+       -I$(top_srcdir)/include \
+       -include Python.h \
+       -include $(top_builddir)/enigma2_config.h
 
--include $(OBJS:.cpp=.d)
+AM_CXXFLAGS = @LIBDDVD_CFLAGS@
 
-installdir = $(pkglibdir)/python/Plugins/Extensions/DVDPlayer
+plugindir = $(pkglibdir)/python/Plugins/Extensions/DVDPlayer
 
-install_PYTHON = \
-       servicedvd.so
+plugin_LTLIBRARIES = servicedvd.la
 
-servicedvd.so:
-       $(CXX) $(CPPFLAGS) -MD $(CXXFLAGS) $(DEFS) -I$(top_srcdir)/include \
-       -Wall -W $(OBJS) -shared -fPIC -Wl,-soname,servicedvd.so -o servicedvd.so \
-       $(LDFLAGS) -ldreamdvd
+servicedvd_la_SOURCES = \
+       servicedvd.cpp \
+       servicedvd.h
 
-all: servicedvd.so
-
-CLEANFILES = servicedvd.so servicedvd.d
+servicedvd_la_LDFLAGS = -avoid-version -module
+servicedvd_la_LIBADD = @LIBDDVD_LIBS@
index 2ba5392..5fbfb0a 100644 (file)
@@ -32,6 +32,7 @@ eServiceFactoryDVD::eServiceFactoryDVD()
        {
                std::list<std::string> extensions;
                extensions.push_back("iso");
+               extensions.push_back("img");
                sc->addServiceFactory(eServiceFactoryDVD::id, this, extensions);
        }
 }
@@ -480,7 +481,10 @@ RESULT eServiceDVD::getName(std::string &name)
        if ( m_ddvd_titlestring[0] != '\0' )
                name = m_ddvd_titlestring;
        else
-               name = m_ref.path;
+               if ( !m_ref.name.empty() )
+                       name = m_ref.name;
+               else
+                       name = m_ref.path;
        return 0;
 }
 
index 5a6e3f3..7a3a9be 100755 (executable)
@@ -1,6 +1,10 @@
 installdir = $(pkglibdir)/python/Plugins/Extensions
 
-SUBDIRS = TuxboxPlugins CutListEditor PicturePlayer MediaScanner MediaPlayer GraphMultiEPG SocketMMI DVDPlayer DVDBurn Modem
+SUBDIRS = TuxboxPlugins CutListEditor PicturePlayer MediaScanner MediaPlayer GraphMultiEPG SocketMMI DVDBurn Modem
+
+if HAVE_LIBDDVD
+SUBDIRS += DVDPlayer
+endif
 
 install_PYTHON =       \
        __init__.py
index 8e80e18..5ce7d03 100644 (file)
@@ -1,17 +1,15 @@
-OBJS = socket_mmi.cpp
+AM_CPPFLAGS = \
+       -I$(top_srcdir) \
+       -I$(top_srcdir)/include \
+       -include Python.h \
+       -include $(top_builddir)/enigma2_config.h
 
--include $(OBJS:.cpp=.d)
+plugindir = $(pkglibdir)/python/Plugins/Extensions/SocketMMI
 
-installdir = $(pkglibdir)/python/Plugins/Extensions/SocketMMI
+plugin_LTLIBRARIES = socketmmi.la
 
-install_PYTHON = \
-       socketmmi.so
+socketmmi_la_SOURCES = \
+       socket_mmi.cpp \
+       socket_mmi.h
 
-socketmmi.so: socket_mmi.cpp socket_mmi.h
-       $(CXX) $(CPPFLAGS) -MD $(CXXFLAGS) $(DEFS) -I$(top_srcdir)/include \
-       -Wall -W $(OBJS) -shared -fPIC -Wl,-soname,socketmmi.so -o socketmmi.so \
-       $(LDFLAGS)
-
-all: socketmmi.so
-
-CLEANFILES = socketmmi.so socketmmi.d
+socketmmi_la_LDFLAGS = -avoid-version -module
index 2c0edf5..52296c6 100755 (executable)
@@ -12,7 +12,7 @@ from ServiceReference import ServiceReference
 from Plugins.Plugin import PluginDescriptor
 from xml.etree.cElementTree import parse as ci_parse
 from Tools.XMLTools import elementsWithTag, mergeText, stringToXML
-from enigma import eDVBCI_UI, eDVBCIInterfaces
+from enigma import eDVBCI_UI, eDVBCIInterfaces, eEnv
 
 from os import system, path as os_path
 
@@ -115,7 +115,7 @@ class CIconfigMenu(Screen):
 
                Screen.__init__(self, session)
                self.ci_slot=ci_slot
-               self.filename="/etc/enigma2/ci"+str(self.ci_slot)+".xml"
+               self.filename = eEnv.resolve("${sysconfdir}/enigma2/ci") + str(self.ci_slot) + ".xml"
 
                self["key_red"] = StaticText(_("Delete"))
                self["key_green"] = StaticText(_("add Service"))
@@ -567,7 +567,7 @@ def activate_all(session):
                        return Len > 0 and definitions[Len-1].text or default   
 
                for ci in range(NUM_CI):
-                       filename="/etc/enigma2/ci"+str(ci)+".xml"
+                       filename = eEnv.resolve("${sysconfdir}/enigma2/ci") + str(ci) + ".xml"
 
                        if not os_path.exists(filename):
                                print "[CI_Activate_Config_CI%d] no config file found" %ci
index b19007c..1f379f1 100644 (file)
 from Plugins.Plugin import PluginDescriptor
-from twisted.internet.protocol import Protocol, Factory
-from twisted.internet import reactor
 from Components.Harddisk import harddiskmanager
+from Tools.Directories import fileExists
 
 hotplugNotifier = [ ]
+bdpoll = None
 
-class Hotplug(Protocol):
-       def connectionMade(self):
-               self.received = ""
+def processHotplugData(self, v):
+       print "hotplug:", v
+       action = v.get("ACTION")
+       device = v.get("DEVPATH")
+       physdevpath = v.get("PHYSDEVPATH")
+       media_state = v.get("X_E2_MEDIA_STATUS")
 
-       def dataReceived(self, data):
-               self.received += data
+       dev = device.split('/')[-1]
 
-       def connectionLost(self, reason):
-               data = self.received.split('\0')[:-1]
+       if action is not None and action == "add":
+               error, blacklisted, removable, is_cdrom, partitions, medium_found = harddiskmanager.addHotplugPartition(dev, physdevpath)
+               if bdpoll and removable or is_cdrom:
+                       bdpoll.addDevice(dev, is_cdrom, medium_found)
+       elif action is not None and action == "remove":
+               if bdpoll:
+                       bdpoll.removeDevice(dev)
+               harddiskmanager.removeHotplugPartition(dev)
+       elif media_state is not None:
+               if media_state == '1':
+                       harddiskmanager.removeHotplugPartition(dev)
+                       harddiskmanager.addHotplugPartition(dev, physdevpath)
+               elif media_state == '0':
+                       harddiskmanager.removeHotplugPartition(dev)
 
-               v = {}
+       for callback in hotplugNotifier:
+               try:
+                       callback(dev, action or media_state)
+               except AttributeError:
+                       hotplugNotifier.remove(callback)
 
-               for x in data:
-                       i = x.find('=')
-                       var, val = x[:i], x[i+1:]
-                       v[var] = val
+CDROM_DRIVE_STATUS = 0x5326
+CDROM_MEDIA_CHANGED = 0x5325
+CDSL_CURRENT = ((int)(~0>>1))
+CDS_NO_INFO = 0
+CDS_NO_DISC = 1
+CDS_TRAY_OPEN = 2
+CDS_DRIVE_NOT_READY = 3
+CDS_DISC_OK = 4
+ENOMEDIUM = 159
+IOC_NRBITS = 8
+IOC_NRSHIFT = 0
+IOC_TYPESHIFT = (IOC_NRSHIFT+IOC_NRBITS)
+BLKRRPART = ((0x12<<IOC_TYPESHIFT) | (95<<IOC_NRSHIFT))
 
-               print "hotplug:", v
+def autostart(reason, **kwargs):
+       if reason == 0:
+               print "starting hotplug handler"
 
-               action = v.get("ACTION")
-               device = v.get("DEVPATH")
-               physdevpath = v.get("PHYSDEVPATH")
-               media_state = v.get("X_E2_MEDIA_STATUS")
+               if fileExists('/dev/.udev'):
+                       global netlink
+                       global bdpoll
+                       from enigma import eSocketNotifier, eTimer, ePythonMessagePump
+                       import socket
+                       from select import POLLIN, POLLPRI
 
-               dev = device.split('/')[-1]
+                       class Netlink:
+                               def __init__(self):
+                                       self.netlink = socket.socket(socket.AF_NETLINK, socket.SOCK_DGRAM, 15)
+                                       self.netlink.setsockopt(socket.SOL_SOCKET, socket.SO_SNDBUF, 65536)
+                                       self.netlink.setsockopt(socket.SOL_SOCKET, socket.SO_RCVBUF, 65536)
+                                       self.netlink.bind((0, 1))
+                                       self.sn = eSocketNotifier(self.netlink.fileno(), POLLIN|POLLPRI)
+                                       self.sn.callback.append(self.dataAvail)
 
-               if action is not None and action == "add":
-                       harddiskmanager.addHotplugPartition(dev, physdevpath)
-               elif action is not None and action == "remove":
-                       harddiskmanager.removeHotplugPartition(dev)
-               elif media_state is not None:
-                       if media_state == '1':
-                               harddiskmanager.removeHotplugPartition(dev)
-                               harddiskmanager.addHotplugPartition(dev, physdevpath)
-                       elif media_state == '0':
-                               harddiskmanager.removeHotplugPartition(dev)
-               
-               for callback in hotplugNotifier:
-                       try:
-                               callback(dev, action or media_state)
-                       except AttributeError:
-                               hotplugNotifier.remove(callback)
+                               def dataAvail(self, what):
+                                       received = self.netlink.recvfrom(16384)
+#                                      print "HOTPLUG(%d):" %(what), received
 
-def autostart(reason, **kwargs):
-       if reason == 0:
-               print "starting hotplug handler"
-               factory = Factory()
-               factory.protocol = Hotplug
+                                       data = received[0].split('\0')[:-1]
+                                       v = {}
+
+                                       for x in data:
+                                               i = x.find('=')
+                                               var, val = x[:i], x[i+1:]
+                                               v[var] = val
+
+                                       if v['SUBSYSTEM'] == 'block' and v['ACTION'] in ('add', 'remove'):
+                                               processHotplugData(self, v)
+
+                       from threading import Thread, Semaphore, Lock
+
+                       class ThreadQueue:
+                               def __init__(self):
+                                       self.__list = [ ]
+                                       self.__lock = Lock()
+
+                               def push(self, val):
+                                       list = self.__list
+                                       lock = self.__lock
+                                       lock.acquire()
+                                       list.append(val)
+                                       lock.release()
+
+                               def pop(self):
+                                       list = self.__list
+                                       lock = self.__lock
+                                       lock.acquire()
+                                       ret = list[0]
+                                       del list[0]
+                                       lock.release()
+                                       return ret
 
-               try:
                        import os
-                       os.remove("/tmp/hotplug.socket")
-               except OSError:
-                       pass
+                       import errno
+                       import fcntl
+
+                       class BDPoll(Thread):
+                               CHECK_INTERVAL = 2000
+                               MSG_MEDIUM_REMOVED = 1
+                               MSG_MEDIUM_INSERTED = 2
+                               MSG_POLL_FINISHED = 4
+                               def __init__(self):
+                                       Thread.__init__(self)
+                                       self.__sema = Semaphore(0)
+                                       self.__lock = Lock()
+                                       self.running = False
+                                       self.devices_to_poll = { }
+                                       self.messages = ThreadQueue()
+                                       self.checkTimer = eTimer()
+                                       self.checkTimer.callback.append(self.timeout)
+                                       self.checkTimer.start(BDPoll.CHECK_INTERVAL, True)
+                                       self.mp = ePythonMessagePump()
+                                       self.mp.recv_msg.get().append(self.gotThreadMsg)
+                                       self.start()
+
+                               def gotThreadMsg(self, msg):
+                                       msg = self.messages.pop()
+                                       if msg[0] == BDPoll.MSG_MEDIUM_REMOVED:
+                                               print "MSG_MEDIUM_REMOVED"
+                                               harddiskmanager.removeHotplugPartition(msg[1])
+                                       elif msg[0] == BDPoll.MSG_MEDIUM_INSERTED:
+                                               print "MSG_MEDIUM_INSERTED"
+                                               harddiskmanager.addHotplugPartition(msg[1])
+                                       elif msg[0] == BDPoll.MSG_POLL_FINISHED:
+                                               self.checkTimer.start(BDPoll.CHECK_INTERVAL, True)
+
+                               def timeout(self):
+                                       self.__sema.release() # start bdpoll loop in thread
+
+                               def is_mounted(self, dev):
+                                       mounts = file('/proc/mounts').read()
+                                       return mounts.find(dev) != -1
+
+                               def run(self):
+                                       sema = self.__sema
+                                       lock = self.__lock
+                                       messages = self.messages
+                                       mp = self.mp
+                                       self.running = True
+                                       while self.running:
+                                               sema.acquire()
+                                               self.__lock.acquire()
+                                               devices_to_poll = self.devices_to_poll.items()
+                                               self.__lock.release()
+                                               devices_to_poll_processed = [ ]
+                                               for device, state in devices_to_poll:
+                                                       got_media = False
+                                                       is_cdrom, prev_media_state = state
+                                                       if is_cdrom:
+                                                               try:
+                                                                       fd = os.open("/dev/" + device, os.O_RDONLY | os.O_NONBLOCK | os.O_EXCL)
+                                                               except OSError, err:
+                                                                       if err.errno == errno.EBUSY:
+                                                                               print "open cdrom exclusive failed:",
+                                                                               if not self.is_mounted(device):
+                                                                                       print "not mounted"
+                                                                                       continue
+                                                                               try:
+                                                                                       print "mounted... try non exclusive"
+                                                                                       fd = os.open("/dev/" + device, os.O_RDONLY | os.O_NONBLOCK)
+                                                                               except OSError, err:
+                                                                                       print "open cdrom not exclusive failed", os.strerror(err.errno)
+                                                                                       continue
+                                                               #here the fs must be valid!
+                                                               try:
+                                                                       ret = fcntl.ioctl(fd, CDROM_DRIVE_STATUS, CDSL_CURRENT)
+                                                               except IOError, err:
+                                                                       print "ioctl CDROM_DRIVE_STATUS failed", os.strerror(err.errno)
+                                                               else:
+                                                                       if ret in (CDS_NO_INFO, CDS_NO_DISC, CDS_TRAY_OPEN, CDS_DRIVE_NOT_READY):
+                                                                               pass
+                                                                       elif ret == CDS_DISC_OK:
+                                                                               #todo new kernels support events to userspace event on media change
+                                                                               #but not 2.6.18.... see hotplug-ng bdpoll.c
+                                                                               got_media = True
+                                                               os.close(fd)
+                                                       else:
+                                                               try:
+                                                                       fd = os.open("/dev/" + device, os.O_RDONLY)
+                                                               except OSError, err:
+                                                                       if err.errno == ENOMEDIUM:
+                                                                               pass
+                                                                       else:
+                                                                            &