davemds pushed a commit to branch python-efl-1.8. http://git.enlightenment.org/bindings/python/python-efl.git/commit/?id=bb84e1dcfbbf7c69cf1a39df3a9ad82f3ebdb84c
commit bb84e1dcfbbf7c69cf1a39df3a9ad82f3ebdb84c Author: davemds <[email protected]> Date: Mon Dec 23 21:34:16 2013 +0100 unbroke the emotion example * copy the theme edj in source, instead of searching for an installed one from the c example, that is not installed by default enymore. * fix usage/import of enums * add the 'p' key to toggle pause state --- examples/emotion/test_emotion.py | 24 ++++++++++++------------ examples/emotion/theme.edj | Bin 0 -> 37808 bytes 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/examples/emotion/test_emotion.py b/examples/emotion/test_emotion.py index 3f89be7..08f9c73 100755 --- a/examples/emotion/test_emotion.py +++ b/examples/emotion/test_emotion.py @@ -1,5 +1,6 @@ #!/usr/bin/env python +import os import optparse import subprocess @@ -8,17 +9,11 @@ from efl import edje from efl import emotion from efl.emotion import Emotion from efl import elementary -from efl.elementary.window import Window +from efl.elementary.window import Window, ELM_WIN_BASIC -def pkgconfig_variable(pkg, var): - output = subprocess.check_output(["pkg-config", "--variable=" + var, pkg]) - return output.decode("utf-8").strip() - - -prefix_dir = pkgconfig_variable("emotion", "prefix") -data_dir = prefix_dir + "/share/emotion/data" -theme_file = data_dir + "/theme.edj" +script_path = os.path.dirname(os.path.abspath(__file__)) +theme_file = os.path.join(script_path, "theme.edj") class MyDecoratedEmotion(Emotion): @@ -201,7 +196,7 @@ class MovieWindow(edje.Edje): print("spu button num: %d" % vid.spu_button_count) def vid_button_change_cb(self, vid): - print ("spu button: %s" % vid.spu_button) + print("spu button: %s" % vid.spu_button) class AppKeyboardEvents(object): @@ -237,6 +232,11 @@ class AppKeyboardEvents(object): print("\tspu channels: %d" % mw.vid.spu_channel_count()) print("\tseekable: %s" % mw.vid.seekable) + def toggle_pause(win): + for mw in win.data["movie_windows"]: + mw.vid.play = not mw.vid.play + print("play is now %s" % mw.vid.play) + def fullscreen_change(win): win.fullscreen = not win.fullscreen print("fullscreen is now %s" % win.fullscreen) @@ -288,6 +288,7 @@ class AppKeyboardEvents(object): "s": (shaped_change,), "b": (bordless_change,), "q": (main_delete_request,), + "p": (toggle_pause,), } def __call__(self, win, info): try: @@ -338,12 +339,11 @@ if __name__ == "__main__"or True: elementary.init() # elementary window - win = Window("test-emotion", elementary.ELM_WIN_BASIC) + win = Window("test-emotion", ELM_WIN_BASIC) win.title_set("python-emotion test application") win.callback_delete_request_add(lambda o: elementary.exit()) win.on_key_down_add(AppKeyboardEvents()) - # edje main scene object scene = edje.Edje(win.evas, file=theme_file, group="background") win.resize_object_add(scene) diff --git a/examples/emotion/theme.edj b/examples/emotion/theme.edj new file mode 100644 index 0000000..6ad4475 Binary files /dev/null and b/examples/emotion/theme.edj differ --
