From 2872929ce24198202fa096d28ab94dea9f925450 Mon Sep 17 00:00:00 2001 From: hschang Date: Thu, 5 Feb 2015 11:34:27 +0900 Subject: [PATCH] Support gles animation. --- configure.ac | 13 +- lib/dvb/pmt.cpp | 1 + lib/gdi/gfbdc.cpp | 33 +++ lib/gdi/grc.cpp | 61 +++++ lib/gdi/grc.h | 22 ++ lib/gui/ewidgetdesktop.cpp | 22 ++ lib/gui/ewidgetdesktop.h | 2 + lib/gui/ewindow.cpp | 25 +++ lib/gui/ewindow.h | 5 + lib/python/Components/VolumeControl.py | 2 + lib/python/Components/config.py | 1 + lib/python/Plugins/Extensions/HbbTV/browser.py | 5 +- lib/python/Plugins/Extensions/HbbTV/plugin.py | 1 - .../SystemPlugins/AnimationSetup/Makefile.am | 7 + .../SystemPlugins/AnimationSetup/__init__.py | 0 .../SystemPlugins/AnimationSetup/meta/Makefile.am | 3 + .../AnimationSetup/meta/plugin_animationsetup.xml | 15 ++ .../Plugins/SystemPlugins/AnimationSetup/plugin.py | 247 +++++++++++++++++++++ lib/python/Plugins/SystemPlugins/Makefile.am | 2 +- lib/python/Screens/ChannelSelection.py | 2 + lib/python/Screens/InfoBarGenerics.py | 6 + lib/python/Screens/Screen.py | 4 + lib/python/Screens/Wizard.py | 1 + lib/python/enigma_python.i | 4 + main/Makefile.am | 1 + main/enigma.cpp | 17 ++ skin.py | 11 + 27 files changed, 508 insertions(+), 5 deletions(-) create mode 100644 lib/python/Plugins/SystemPlugins/AnimationSetup/Makefile.am create mode 100644 lib/python/Plugins/SystemPlugins/AnimationSetup/__init__.py create mode 100644 lib/python/Plugins/SystemPlugins/AnimationSetup/meta/Makefile.am create mode 100644 lib/python/Plugins/SystemPlugins/AnimationSetup/meta/plugin_animationsetup.xml create mode 100644 lib/python/Plugins/SystemPlugins/AnimationSetup/plugin.py diff --git a/configure.ac b/configure.ac index 6063799..89cb2be 100644 --- a/configure.ac +++ b/configure.ac @@ -65,6 +65,15 @@ if test x"$setrighthalfvfdskin" != xno ; then fi AM_CONDITIONAL(SET_RIGHT_HALF_VFD_SKIN, test x"$setrighthalfvfdskin" != xno) +AC_ARG_WITH(libvugles2, + AS_HELP_STRING([--with-libvugles2],[use libvugles2, yes or no]), + [with_libvugles2=$withval],[with_libvugles2=no]) +if test "$with_libvugles2" = "yes"; then + PKG_CHECK_MODULES(LIBVUGLES2, [libvugles2]) + GLES_CFLAGS="-DUSE_LIBVUGLES2" +fi +AM_CONDITIONAL(HAVE_LIBVUGLES2, test "$with_libvugles2" = "yes") + AC_ARG_WITH(libsdl, AS_HELP_STRING([--with-libsdl],[use libsdl, yes or no]), [with_libsdl=$withval],[with_libsdl=no]) @@ -116,7 +125,7 @@ AC_SUBST(ENIGMA2_CFLAGS) CPPFLAGS="$CPPFLAGS $PYTHON_CPPFLAGS" CFLAGS="$CFLAGS $DEBUG_CFLAGS -Wall" -CXXFLAGS="$CXXFLAGS $DEBUG_CFLAGS -Wall $BASE_CFLAGS $ENIGMA2_CFLAGS $PTHREAD_CFLAGS" +CXXFLAGS="$CXXFLAGS $DEBUG_CFLAGS -Wall $BASE_CFLAGS $ENIGMA2_CFLAGS $PTHREAD_CFLAGS $GLES_CFLAGS" AC_CONFIG_FILES([ Makefile @@ -284,6 +293,8 @@ lib/python/Plugins/SystemPlugins/NetDrive/Makefile lib/python/Plugins/SystemPlugins/NetDrive/meta/Makefile lib/python/Plugins/SystemPlugins/AudioEffect/Makefile lib/python/Plugins/SystemPlugins/AudioEffect/meta/Makefile +lib/python/Plugins/SystemPlugins/AnimationSetup/Makefile +lib/python/Plugins/SystemPlugins/AnimationSetup/meta/Makefile lib/python/Tools/Makefile lib/service/Makefile lib/components/Makefile diff --git a/lib/dvb/pmt.cpp b/lib/dvb/pmt.cpp index 96645a1..febfd78 100644 --- a/lib/dvb/pmt.cpp +++ b/lib/dvb/pmt.cpp @@ -169,6 +169,7 @@ void eDVBServicePMTHandler::PATready(int) ProgramAssociationConstIterator program; for (program = pat.getPrograms()->begin(); pmtpid == -1 && program != pat.getPrograms()->end(); ++program) { + ++cnt; if (eServiceID((*program)->getProgramNumber()) == m_reference.getServiceID()) pmtpid = (*program)->getProgramMapPid(); if (++cnt == 1 && pmtpid_single == -1 && pmtpid == -1) diff --git a/lib/gdi/gfbdc.cpp b/lib/gdi/gfbdc.cpp index a4f65eb..d3cc55f 100644 --- a/lib/gdi/gfbdc.cpp +++ b/lib/gdi/gfbdc.cpp @@ -6,6 +6,9 @@ #include #include +#ifdef USE_LIBVUGLES2 +#include +#endif gFBDC::gFBDC() { @@ -125,8 +128,38 @@ void gFBDC::exec(const gOpcode *o) break; } case gOpcode::flush: +#ifdef USE_LIBVUGLES2 + if (gles_is_animation()) + gles_do_animation(); + else + fb->blit(); +#else fb->blit(); +#endif + break; + case gOpcode::sendShow: + { +#ifdef USE_LIBVUGLES2 + gles_set_buffer((unsigned int *)surface.data); + gles_set_animation(1, o->parm.setShowHideInfo->point.x(), o->parm.setShowHideInfo->point.y(), o->parm.setShowHideInfo->size.width(), o->parm.setShowHideInfo->size.height()); +#endif + break; + } + case gOpcode::sendHide: + { +#ifdef USE_LIBVUGLES2 + gles_set_buffer((unsigned int *)surface.data); + gles_set_animation(0, o->parm.setShowHideInfo->point.x(), o->parm.setShowHideInfo->point.y(), o->parm.setShowHideInfo->size.width(), o->parm.setShowHideInfo->size.height()); +#endif break; + } +#ifdef USE_LIBVUGLES2 + case gOpcode::setView: + { + gles_viewport(o->parm.setViewInfo->size.width(), o->parm.setViewInfo->size.height(), fb->Stride()); + break; + } +#endif default: gDC::exec(o); break; diff --git a/lib/gdi/grc.cpp b/lib/gdi/grc.cpp index a45b3b1..ce33171 100644 --- a/lib/gdi/grc.cpp +++ b/lib/gdi/grc.cpp @@ -3,6 +3,9 @@ #include #include #include +#ifdef USE_LIBVUGLES2 +#include +#endif #ifndef SYNC_PAINT void *gRC::thread_wrapper(void *ptr) @@ -94,6 +97,12 @@ void gRC::submit(const gOpcode &o) void *gRC::thread() { int need_notify = 0; +#ifdef USE_LIBVUGLES2 + if (gles_open()) { + gles_state_open(); + gles_viewport(720, 576, 720 * 4); + } +#endif #ifndef SYNC_PAINT while (1) { @@ -185,6 +194,10 @@ void *gRC::thread() #endif } } +#ifdef USE_LIBVUGLES2 + gles_state_close(); + gles_close(); +#endif #ifndef SYNC_PAINT pthread_exit(0); #endif @@ -594,6 +607,46 @@ void gPainter::end() return; } +void gPainter::sendShow(ePoint point, eSize size) +{ + if ( m_dc->islocked() ) + return; + gOpcode o; + o.opcode=gOpcode::sendShow; + o.dc = m_dc.grabRef(); + o.parm.setShowHideInfo = new gOpcode::para::psetShowHideInfo; + o.parm.setShowHideInfo->point = point; + o.parm.setShowHideInfo->size = size; + m_rc->submit(o); +} + +void gPainter::sendHide(ePoint point, eSize size) +{ + if ( m_dc->islocked() ) + return; + gOpcode o; + o.opcode=gOpcode::sendHide; + o.dc = m_dc.grabRef(); + o.parm.setShowHideInfo = new gOpcode::para::psetShowHideInfo; + o.parm.setShowHideInfo->point = point; + o.parm.setShowHideInfo->size = size; + m_rc->submit(o); +} + +#ifdef USE_LIBVUGLES2 +void gPainter::setView(eSize size) +{ + if ( m_dc->islocked() ) + return; + gOpcode o; + o.opcode=gOpcode::setView; + o.dc = m_dc.grabRef(); + o.parm.setViewInfo = new gOpcode::para::psetViewInfo; + o.parm.setViewInfo->size = size; + m_rc->submit(o); +} +#endif + gDC::gDC() { m_spinner_pic = 0; @@ -781,6 +834,14 @@ void gDC::exec(const gOpcode *o) break; case gOpcode::flush: break; + case gOpcode::sendShow: + break; + case gOpcode::sendHide: + break; +#ifdef USE_LIBVUGLES2 + case gOpcode::setView: + break; +#endif case gOpcode::enableSpinner: enableSpinner(); break; diff --git a/lib/gdi/grc.h b/lib/gdi/grc.h index 38caa10..16f7db7 100644 --- a/lib/gdi/grc.h +++ b/lib/gdi/grc.h @@ -64,6 +64,11 @@ struct gOpcode shutdown, setCompositing, + sendShow, + sendHide, +#ifdef USE_LIBVUGLES2 + setView, +#endif } opcode; gDC *dc; @@ -142,6 +147,18 @@ struct gOpcode } *setOffset; gCompositingData *setCompositing; + + struct psetShowHideInfo + { + ePoint point; + eSize size; + } *setShowHideInfo; +#ifdef USE_LIBVUGLES2 + struct psetViewInfo + { + eSize size; + } *setViewInfo; +#endif } parm; }; @@ -265,6 +282,11 @@ public: void setCompositing(gCompositingData *comp); void flush(); + void sendShow(ePoint point, eSize size); + void sendHide(ePoint point, eSize size); +#ifdef USE_LIBVUGLES2 + void setView(eSize size); +#endif }; class gDC: public iObject diff --git a/lib/gui/ewidgetdesktop.cpp b/lib/gui/ewidgetdesktop.cpp index 08bd047..1951b61 100644 --- a/lib/gui/ewidgetdesktop.cpp +++ b/lib/gui/ewidgetdesktop.cpp @@ -521,4 +521,26 @@ void eWidgetDesktop::resize(eSize size) { m_screen.m_dirty_region = gRegion(eRect(ePoint(0, 0), size)); m_screen.m_screen_size = size; +#ifdef USE_LIBVUGLES2 + gPainter painter(m_screen.m_dc); + painter.setView(size); +#endif +} + +void eWidgetDesktop::sendShow(ePoint point, eSize size) +{ + if(m_style_id!=0) + return; + + gPainter painter(m_screen.m_dc); + painter.sendShow(point, size); +} + +void eWidgetDesktop::sendHide(ePoint point, eSize size) +{ + if(m_style_id!=0) + return; + + gPainter painter(m_screen.m_dc); + painter.sendHide(point, size); } diff --git a/lib/gui/ewidgetdesktop.h b/lib/gui/ewidgetdesktop.h index 4ea5b57..29bce1c 100644 --- a/lib/gui/ewidgetdesktop.h +++ b/lib/gui/ewidgetdesktop.h @@ -73,6 +73,8 @@ public: void resize(eSize size); eSize size() const { return m_screen.m_screen_size; } + void sendShow(ePoint point, eSize size); + void sendHide(ePoint point, eSize size); private: ePtrList m_root; void calcWidgetClipRegion(eWidget *widget, gRegion &parent_visible); diff --git a/lib/gui/ewindow.cpp b/lib/gui/ewindow.cpp index 83e65ec..39a3f24 100644 --- a/lib/gui/ewindow.cpp +++ b/lib/gui/ewindow.cpp @@ -9,6 +9,7 @@ eWindow::eWindow(eWidgetDesktop *desktop, int z): eWidget(0) { m_flags = 0; + m_animation_mode = 0x11; m_desktop = desktop; /* ask style manager for current style */ ePtr mgr; @@ -114,3 +115,27 @@ int eWindow::event(int event, void *data, void *data2) return eWidget::event(event, data, data2); } +void eWindow::show() +{ + if (m_animation_mode & 0x01) + m_desktop->sendShow(position(), size()); + eWidget::show(); +} + +void eWindow::hide() +{ + if (m_animation_mode & 0x10) + m_desktop->sendHide(position(), size()); + eWidget::hide(); +} + +void eWindow::setAnimationMode(int mode) +{ + /* + * 0x00 = animation off + * 0x01 = show on + * 0x10 = hide on + * 0x11 = animation on + */ + m_animation_mode = mode; +} diff --git a/lib/gui/ewindow.h b/lib/gui/ewindow.h index 265f512..ee1e7d8 100644 --- a/lib/gui/ewindow.h +++ b/lib/gui/ewindow.h @@ -15,6 +15,9 @@ public: void setTitle(const std::string &string); std::string getTitle() const; eWidget *child() { return m_child; } + + void show(); + void hide(); enum { wfNoBorder = 1 @@ -24,6 +27,7 @@ public: void setFlag(int flags); void clearFlag(int flags); + void setAnimationMode(int mode); protected: enum eWindowEvents { @@ -35,6 +39,7 @@ private: eWidget *m_child; int m_flags; eWidgetDesktop *m_desktop; + int m_animation_mode; }; #endif diff --git a/lib/python/Components/VolumeControl.py b/lib/python/Components/VolumeControl.py index 3810292..e42e06c 100644 --- a/lib/python/Components/VolumeControl.py +++ b/lib/python/Components/VolumeControl.py @@ -24,7 +24,9 @@ class VolumeControl: config.audio.volume = ConfigInteger(default = 100, limits = (0, 100)) self.volumeDialog = session.instantiateDialog(Volume) + self.volumeDialog.setAnimationMode(0) self.muteDialog = session.instantiateDialog(Mute) + self.muteDialog.setAnimationMode(0) self.hideVolTimer = eTimer() self.hideVolTimer.callback.append(self.volHide) diff --git a/lib/python/Components/config.py b/lib/python/Components/config.py index e6abaa4..e27de86 100755 --- a/lib/python/Components/config.py +++ b/lib/python/Components/config.py @@ -1068,6 +1068,7 @@ class ConfigText(ConfigElement, NumericalTextInput): if session is not None: from Screens.NumericalTextInputHelpDialog import NumericalTextInputHelpDialog self.help_window = session.instantiateDialog(NumericalTextInputHelpDialog, self) + self.help_window.setAnimationMode(0) self.help_window.show() def onDeselect(self, session): diff --git a/lib/python/Plugins/Extensions/HbbTV/browser.py b/lib/python/Plugins/Extensions/HbbTV/browser.py index e7e7386..73af39e 100644 --- a/lib/python/Plugins/Extensions/HbbTV/browser.py +++ b/lib/python/Plugins/Extensions/HbbTV/browser.py @@ -296,8 +296,9 @@ class BrowserPreferenceWindow(ConfigListScreen, Screen): mode = 1 self._keymapType = self.menuItemKeyboardLayout.value BrowserSetting().setData(url, mode, self._keymapType) - - VBController.command('CONTROL_RELOAD_KEYMAP') + # send contorller + #command_util = getCommandUtil() + #command_util.sendCommand('OP_BROWSER_NEED_RELOAD_KEYMAP') self.close() def keyRed(self): diff --git a/lib/python/Plugins/Extensions/HbbTV/plugin.py b/lib/python/Plugins/Extensions/HbbTV/plugin.py index 1dd214c..22d5f69 100644 --- a/lib/python/Plugins/Extensions/HbbTV/plugin.py +++ b/lib/python/Plugins/Extensions/HbbTV/plugin.py @@ -53,7 +53,6 @@ _OPCODE_LIST = [ 'OOIF_BROADCAST_PLAY', 'OOIF_BROADCAST_STOP', 'OOIF_BROADCAST_CHECK', - 'CONTROL_RELOAD_KEYMAP', 'OPCODE_END' ] diff --git a/lib/python/Plugins/SystemPlugins/AnimationSetup/Makefile.am b/lib/python/Plugins/SystemPlugins/AnimationSetup/Makefile.am new file mode 100644 index 0000000..6530a96 --- /dev/null +++ b/lib/python/Plugins/SystemPlugins/AnimationSetup/Makefile.am @@ -0,0 +1,7 @@ +installdir = $(pkglibdir)/python/Plugins/SystemPlugins/AnimationSetup + +SUBDIRS = meta + +install_PYTHON = \ + __init__.py \ + plugin.py diff --git a/lib/python/Plugins/SystemPlugins/AnimationSetup/__init__.py b/lib/python/Plugins/SystemPlugins/AnimationSetup/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/lib/python/Plugins/SystemPlugins/AnimationSetup/meta/Makefile.am b/lib/python/Plugins/SystemPlugins/AnimationSetup/meta/Makefile.am new file mode 100644 index 0000000..a2721f5 --- /dev/null +++ b/lib/python/Plugins/SystemPlugins/AnimationSetup/meta/Makefile.am @@ -0,0 +1,3 @@ +installdir = $(datadir)/meta + +dist_install_DATA = plugin_animationsetup.xml diff --git a/lib/python/Plugins/SystemPlugins/AnimationSetup/meta/plugin_animationsetup.xml b/lib/python/Plugins/SystemPlugins/AnimationSetup/meta/plugin_animationsetup.xml new file mode 100644 index 0000000..7ea505e --- /dev/null +++ b/lib/python/Plugins/SystemPlugins/AnimationSetup/meta/plugin_animationsetup.xml @@ -0,0 +1,15 @@ + + + + + + smlee + Animation Setup + enigma2-plugin-systemplugins-animationsetup + Animation Setup + Animation Setup + + + + + diff --git a/lib/python/Plugins/SystemPlugins/AnimationSetup/plugin.py b/lib/python/Plugins/SystemPlugins/AnimationSetup/plugin.py new file mode 100644 index 0000000..f289b34 --- /dev/null +++ b/lib/python/Plugins/SystemPlugins/AnimationSetup/plugin.py @@ -0,0 +1,247 @@ +from Screens.Screen import Screen +from Screens.MessageBox import MessageBox +from Components.ActionMap import ActionMap +from Components.ConfigList import ConfigListScreen +from Components.MenuList import MenuList +from Components.Sources.StaticText import StaticText +from Components.config import config, ConfigNumber, ConfigSelectionNumber, getConfigListEntry +from Plugins.Plugin import PluginDescriptor + +from enigma import setAnimation_current, setAnimation_speed + +# default = slide to left +g_default = { + "current": 6, + "speed" : 20, +} +g_max_speed = 30 + +g_animation_paused = False +g_orig_show = None +g_orig_doClose = None + +config.misc.window_animation_default = ConfigNumber(default=g_default["current"]) +config.misc.window_animation_speed = ConfigSelectionNumber(1, g_max_speed, 1, default=g_default["speed"]) + +class AnimationSetupConfig(ConfigListScreen, Screen): + skin= """ + + + + + + + + + + + + """ + + def __init__(self, session): + self.session = session + self.entrylist = [] + + Screen.__init__(self, session) + ConfigListScreen.__init__(self, self.entrylist) + + self["actions"] = ActionMap(["OkCancelActions", "ColorActions",], { + "ok" : self.keyGreen, + "green" : self.keyGreen, + "yellow" : self.keyYellow, + "red" : self.keyRed, + "cancel" : self.keyRed, + }, -2) + self["key_red"] = StaticText(_("Cancel")) + self["key_green"] = StaticText(_("Save")) + self["key_yellow"] = StaticText(_("Default")) + + self.makeConfigList() + self.onLayoutFinish.append(self.layoutFinished) + + def layoutFinished(self): + self.setTitle(_('Animation Setup')) + + def keyGreen(self): + config.misc.window_animation_speed.save() + setAnimation_speed(int(config.misc.window_animation_speed.value)) + self.close() + + def keyRed(self): + config.misc.window_animation_speed.cancel() + self.close() + + def keyYellow(self): + global g_default + config.misc.window_animation_speed.value = g_default["speed"] + self.makeConfigList() + + def keyLeft(self): + ConfigListScreen.keyLeft(self) + + def keyRight(self): + ConfigListScreen.keyRight(self) + + def makeConfigList(self): + self.entrylist = [] + + entrySpeed = getConfigListEntry(_("Animation Speed"), config.misc.window_animation_speed) + self.entrylist.append(entrySpeed) + self["config"].list = self.entrylist + self["config"].l.setList(self.entrylist) + + +class AnimationSetupScreen(Screen): + animationSetupItems = [ + {"idx":0, "name":_("Disable Animations")}, + {"idx":1, "name":_("Simple fade")}, + {"idx":2, "name":_("Grow drop")}, + {"idx":3, "name":_("Grow from left")}, + {"idx":4, "name":_("Popup")}, + {"idx":5, "name":_("Slide drop")}, + {"idx":6, "name":_("Slide left to right")}, + {"idx":7, "name":_("Slide top to bottom")}, + {"idx":8, "name":_("Stripes")}, + ] + + skin = """ + + + + + + + + + + + + + + """ + + def __init__(self, session): + + self.skin = AnimationSetupScreen.skin + Screen.__init__(self, session) + + self.animationList = [] + + self["introduction"] = StaticText(_("* current animation")) + self["key_red"] = StaticText(_("Cancel")) + self["key_green"] = StaticText(_("Save")) + self["key_yellow"] = StaticText(_("Setting")) + self["key_blue"] = StaticText(_("Preview")) + + self["actions"] = ActionMap(["SetupActions", "ColorActions"], + { + "cancel": self.keyclose, + "save": self.ok, + "ok" : self.ok, + "yellow": self.config, + "blue": self.preview + }, -3) + + self["list"] = MenuList(self.animationList) + + self.onLayoutFinish.append(self.layoutFinished) + + def layoutFinished(self): + l = [] + for x in self.animationSetupItems: + key = x.get("idx", 0) + name = x.get("name", "??") + if key == config.misc.window_animation_default.value: + name = "* %s" % (name) + l.append( (name, key) ) + + self["list"].setList(l) + + def ok(self): + current = self["list"].getCurrent() + if current: + key = current[1] + config.misc.window_animation_default.value = key + config.misc.window_animation_default.save() + setAnimation_current(key) + self.close() + + def keyclose(self): + setAnimation_current(config.misc.window_animation_default.value) + setAnimation_speed(int(config.misc.window_animation_speed.value)) + self.close() + + def config(self): + self.session.open(AnimationSetupConfig) + + def preview(self): + current = self["list"].getCurrent() + if current: + global g_animation_paused + tmp = g_animation_paused + g_animation_paused = False + + setAnimation_current(current[1]) + self.session.open(MessageBox, current[0], MessageBox.TYPE_INFO, timeout=3) + g_animation_paused = tmp + +def checkAttrib(self, paused): + global g_animation_paused + if g_animation_paused is paused and self.skinAttributes is not None: + for (attr, value) in self.skinAttributes: + if attr == "animationPaused" and value in ("1", "on"): + return True + return False + +def screen_show(self): + global g_animation_paused + if g_animation_paused: + setAnimation_current(0) + + g_orig_show(self) + + if checkAttrib(self, False): + g_animation_paused = True + +def screen_doClose(self): + global g_animation_paused + if checkAttrib(self, True): + g_animation_paused = False + setAnimation_current(config.misc.window_animation_default.value) + g_orig_doClose(self) + +def animationSetupMain(session, **kwargs): + session.open(AnimationSetupScreen) + +def startAnimationSetup(menuid): + if menuid != "system": + return [] + + return [( _("Animations"), animationSetupMain, "animation_setup", None)] + +def sessionAnimationSetup(session, reason, **kwargs): + setAnimation_current(config.misc.window_animation_default.value) + setAnimation_speed(int(config.misc.window_animation_speed.value)) + + global g_orig_show, g_orig_doClose + if g_orig_show is None: + g_orig_show = Screen.show + if g_orig_doClose is None: + g_orig_doClose = Screen.doClose + Screen.show = screen_show + Screen.doClose = screen_doClose + +def Plugins(**kwargs): + plugin_list = [ + PluginDescriptor( + name = "Animations", + description = "Setup UI animations", + where = PluginDescriptor.WHERE_MENU, + needsRestart = False, + fnc = startAnimationSetup), + PluginDescriptor( + where = PluginDescriptor.WHERE_SESSIONSTART, + needsRestart = False, + fnc = sessionAnimationSetup), + ] + return plugin_list; diff --git a/lib/python/Plugins/SystemPlugins/Makefile.am b/lib/python/Plugins/SystemPlugins/Makefile.am index c7109e4..cf3498b 100755 --- a/lib/python/Plugins/SystemPlugins/Makefile.am +++ b/lib/python/Plugins/SystemPlugins/Makefile.am @@ -7,7 +7,7 @@ SUBDIRS = SoftwareManager FrontprocessorUpgrade PositionerSetup Satfinder \ TempFanControl Fancontrol FPGAUpgrade WirelessLanSetup ManualFancontrol \ Blindscan RemoteControlCode UI3DSetup UIPositionSetup HDMICEC LEDBrightnessSetup \ FirmwareUpgrade CrashReport 3GModemManager WirelessAccessPoint ZappingModeSelection \ - DeviceManager TransCodingSetup WOLSetup NetDrive AudioEffect + DeviceManager TransCodingSetup WOLSetup NetDrive AudioEffect AnimationSetup install_PYTHON = \ __init__.py diff --git a/lib/python/Screens/ChannelSelection.py b/lib/python/Screens/ChannelSelection.py index 688fe50..6813381 100755 --- a/lib/python/Screens/ChannelSelection.py +++ b/lib/python/Screens/ChannelSelection.py @@ -231,6 +231,7 @@ class ChannelContextMenu(Screen): if self.session.pipshown: del self.session.pip self.session.pip = self.session.instantiateDialog(PictureInPicture) + self.session.pip.setAnimationMode(0) self.session.pip.show() newservice = self.csel.servicelist.getCurrent() if self.session.pip.playService(newservice): @@ -1431,6 +1432,7 @@ class ChannelSelectionRadio(ChannelSelectionBase, ChannelSelectionEdit, ChannelS self.onLayoutFinish.append(self.onCreate) self.info = session.instantiateDialog(RadioInfoBar) # our simple infobar + self.info.setAnimationMode(0) self["actions"] = ActionMap(["OkCancelActions", "TvRadioActions"], { diff --git a/lib/python/Screens/InfoBarGenerics.py b/lib/python/Screens/InfoBarGenerics.py index 80cc196..78d9984 100755 --- a/lib/python/Screens/InfoBarGenerics.py +++ b/lib/python/Screens/InfoBarGenerics.py @@ -47,10 +47,12 @@ from Menu import MainMenu, mdom class InfoBarDish: def __init__(self): self.dishDialog = self.session.instantiateDialog(Dish) + self.dishDialog.setAnimationMode(0) class InfoBarUnhandledKey: def __init__(self): self.unhandledKeyDialog = self.session.instantiateDialog(UnhandledKey) + self.unhandledKeyDialog.setAnimationMode(0) self.hideUnhandledKeySymbolTimer = eTimer() self.hideUnhandledKeySymbolTimer.callback.append(self.unhandledKeyDialog.hide) self.checkUnusedTimer = eTimer() @@ -687,6 +689,7 @@ class InfoBarRdsDecoder: """provides RDS and Rass support/display""" def __init__(self): self.rds_display = self.session.instantiateDialog(RdsInfoDisplay) + self.rds_display.setAnimationMode(0) self.rass_interactive = None self.__event_tracker = ServiceEventTracker(screen=self, eventmap= @@ -1105,6 +1108,7 @@ class InfoBarPVRState: def __init__(self, screen=PVRState, force_show = False): self.onPlayStateChanged.append(self.__playStateChanged) self.pvrStateDialog = self.session.instantiateDialog(screen) + self.pvrStateDialog.setAnimationMode(0) self.onShow.append(self._mayShow) self.onHide.append(self.pvrStateDialog.hide) self.force_show = force_show @@ -1459,6 +1463,7 @@ class InfoBarPiP: self.session.pipshown = False else: self.session.pip = self.session.instantiateDialog(PictureInPicture) + self.session.pip.setAnimationMode(0) self.session.pip.show() newservice = self.session.nav.getCurrentlyPlayingServiceReference() if self.session.pip.playService(newservice): @@ -2227,6 +2232,7 @@ class InfoBarSubtitleSupport(object): def __init__(self): object.__init__(self) self.subtitle_window = self.session.instantiateDialog(SubtitleDisplay) + self.subtitle_window.setAnimationMode(0) self.__subtitles_enabled = False self.__event_tracker = ServiceEventTracker(screen=self, eventmap= diff --git a/lib/python/Screens/Screen.py b/lib/python/Screens/Screen.py index 4a0accd..1d39b7c 100644 --- a/lib/python/Screens/Screen.py +++ b/lib/python/Screens/Screen.py @@ -165,6 +165,10 @@ class Screen(dict, GUISkin): if isinstance(val, GUIComponent) or isinstance(val, Source): val.onHide() + def setAnimationMode(self, mode): + if self.instance: + self.instance.setAnimationMode(mode) + def __repr__(self): return str(type(self)) diff --git a/lib/python/Screens/Wizard.py b/lib/python/Screens/Wizard.py index 40cceb9..eaa1d09 100755 --- a/lib/python/Screens/Wizard.py +++ b/lib/python/Screens/Wizard.py @@ -602,6 +602,7 @@ class Wizard(Screen): self.configInstance = self.session.instantiateDialog(self.wizard[self.currStep]["config"]["screen"]) else: self.configInstance = self.session.instantiateDialog(self.wizard[self.currStep]["config"]["screen"], eval(self.wizard[self.currStep]["config"]["args"])) + self.configInstance.setAnimationMode(0) self["config"].l.setList(self.configInstance["config"].list) callbacks = self.configInstance["config"].onSelectionChanged self.configInstance["config"].destroy() diff --git a/lib/python/enigma_python.i b/lib/python/enigma_python.i index 6386702..9891fb3 100755 --- a/lib/python/enigma_python.i +++ b/lib/python/enigma_python.i @@ -345,6 +345,8 @@ extern int getPrevAsciiCode(); extern void addFont(const char *filename, const char *alias, int scale_factor, int is_replacement); extern const char *getEnigmaVersionString(); extern void dump_malloc_stats(void); +extern void setAnimation_current(int a); +extern void setAnimation_speed(int speed); %} extern void addFont(const char *filename, const char *alias, int scale_factor, int is_replacement); @@ -354,3 +356,5 @@ extern void quitMainloop(int exit_code); extern eApplication *getApplication(); extern const char *getEnigmaVersionString(); extern void dump_malloc_stats(void); +extern void setAnimation_current(int a); +extern void setAnimation_speed(int speed); diff --git a/main/Makefile.am b/main/Makefile.am index a65b4ac..74e72dc 100644 --- a/main/Makefile.am +++ b/main/Makefile.am @@ -44,6 +44,7 @@ enigma2_LDADD = \ @BASE_LIBS@ \ @LIBGIF_LIBS@ \ @LIBJPEG_LIBS@ \ + @LIBVUGLES2_LIBS@ \ @LIBSDL_LIBS@ \ @LIBXINE_LIBS@ \ @LIBXMLCCWRAP_LIBS@ \ diff --git a/main/enigma.cpp b/main/enigma.cpp index 91645d8..49c5017 100644 --- a/main/enigma.cpp +++ b/main/enigma.cpp @@ -327,3 +327,20 @@ void dump_malloc_stats(void) struct mallinfo mi = mallinfo(); eDebug("MALLOC: %d total", mi.uordblks); } + +#ifdef USE_LIBVUGLES2 +#include + +void setAnimation_current(int a) +{ + gles_set_animation_func(a); +} + +void setAnimation_speed(int speed) +{ + gles_set_animation_speed(speed); +} +#else +void setAnimation_current(int a) {} +void setAnimation_speed(int speed) {} +#endif diff --git a/skin.py b/skin.py index 19da203..a0190f1 100755 --- a/skin.py +++ b/skin.py @@ -140,6 +140,17 @@ def applySingleAttribute(guiObject, desktop, attrib, value, scale = ((1,1),(1,1) guiObject.move(parsePosition(value, scale, desktop, guiObject.csize())) elif attrib == 'size': guiObject.resize(parseSize(value, scale)) + elif attrib == 'animationPaused': + pass + elif attrib == 'animationMode': + guiObject.setAnimationMode( + { "disable": 0x00, + "off": 0x00, + "offshow": 0x10, + "offhide": 0x01, + "onshow": 0x01, + "onhide": 0x10, + }[value]) elif attrib == 'title': guiObject.setTitle(_(value)) elif attrib == 'text': -- 2.7.4