diff options
author | Dave Andreoli <dave@gurumeditation.it> | 2015-04-14 22:55:20 +0200 |
---|---|---|
committer | Dave Andreoli <dave@gurumeditation.it> | 2015-04-14 22:55:20 +0200 |
commit | eb60fbc01ea31fb3ad9e48c33d7f14aef51db8ae (patch) | |
tree | d4fc89de78462f5e64a8d964a31231182f291933 | |
parent | 61590afc6f86cd1ff800f19b3387b54f606386b0 (diff) |
Fix elm.Video test to work again
also put in a forgotten change from last commit
-rw-r--r-- | efl/elementary/layout_class.pxd | 1 | ||||
-rw-r--r-- | examples/elementary/test_video.py | 33 |
2 files changed, 7 insertions, 27 deletions
diff --git a/efl/elementary/layout_class.pxd b/efl/elementary/layout_class.pxd index 94cbf57..f9a8a42 100644 --- a/efl/elementary/layout_class.pxd +++ b/efl/elementary/layout_class.pxd | |||
@@ -28,6 +28,7 @@ cdef extern from "Elementary.h": | |||
28 | Eina_Bool elm_layout_text_set(Evas_Object *obj, const char *part, const char *text) | 28 | Eina_Bool elm_layout_text_set(Evas_Object *obj, const char *part, const char *text) |
29 | const char * elm_layout_text_get(const Evas_Object *obj, const char *part) | 29 | const char * elm_layout_text_get(const Evas_Object *obj, const char *part) |
30 | Eina_Bool elm_layout_file_set(Evas_Object *obj, const char *file, const char *group) | 30 | Eina_Bool elm_layout_file_set(Evas_Object *obj, const char *file, const char *group) |
31 | void elm_layout_file_get(Evas_Object *obj, const char **file, const char **group) | ||
31 | int elm_layout_freeze(Evas_Object *obj) | 32 | int elm_layout_freeze(Evas_Object *obj) |
32 | int elm_layout_thaw(Evas_Object *obj) | 33 | int elm_layout_thaw(Evas_Object *obj) |
33 | Eina_Bool elm_layout_theme_set(Evas_Object *obj, const char *clas, const char *group, const char *style) | 34 | Eina_Bool elm_layout_theme_set(Evas_Object *obj, const char *clas, const char *group, const char *style) |
diff --git a/examples/elementary/test_video.py b/examples/elementary/test_video.py index 795b58d..20bdab3 100644 --- a/examples/elementary/test_video.py +++ b/examples/elementary/test_video.py | |||
@@ -1,13 +1,11 @@ | |||
1 | #!/usr/bin/env python | 1 | #!/usr/bin/env python |
2 | # encoding: utf-8 | 2 | # encoding: utf-8 |
3 | 3 | ||
4 | from efl.evas import EVAS_HINT_EXPAND, EVAS_HINT_FILL, EXPAND_BOTH, FILL_BOTH, \ | 4 | from efl.evas import EVAS_HINT_EXPAND, EVAS_HINT_FILL, EXPAND_BOTH, FILL_BOTH |
5 | EVAS_CALLBACK_MOUSE_MOVE, EVAS_CALLBACK_MOUSE_IN, EVAS_CALLBACK_MOUSE_OUT | ||
6 | from efl import elementary | 5 | from efl import elementary |
7 | from efl.elementary.window import StandardWindow | 6 | from efl.elementary.window import StandardWindow |
8 | from efl.elementary.box import Box | 7 | from efl.elementary.box import Box |
9 | from efl.elementary.button import Button | 8 | from efl.elementary.button import Button |
10 | from efl.elementary.notify import Notify, ELM_NOTIFY_ORIENT_BOTTOM | ||
11 | from efl.elementary.fileselector_button import FileselectorButton | 9 | from efl.elementary.fileselector_button import FileselectorButton |
12 | from efl.elementary.table import Table | 10 | from efl.elementary.table import Table |
13 | from efl.elementary.video import Video, Player | 11 | from efl.elementary.video import Video, Player |
@@ -20,46 +18,27 @@ def my_bt_open(bt, vfile, video): | |||
20 | print(video.file) | 18 | print(video.file) |
21 | print(video.file_get()) | 19 | print(video.file_get()) |
22 | 20 | ||
23 | def notify_show(video, event, no): | ||
24 | no.show() | ||
25 | |||
26 | def notify_block(video, event, no): | ||
27 | no.timeout = 0.0 | ||
28 | no.show() | ||
29 | |||
30 | def notify_unblock(video, event, no): | ||
31 | no.timeout = 3.0 | ||
32 | no.show() | ||
33 | |||
34 | def video_clicked(obj): | 21 | def video_clicked(obj): |
35 | win = StandardWindow("video", "video", autodel=True, size=(800, 600)) | 22 | win = StandardWindow("video", "video", autodel=True, size=(800, 600)) |
36 | win.alpha = True # Needed to turn video fast path on | 23 | win.alpha = True # Needed to turn video fast path on |
37 | 24 | ||
38 | video = Video(win, size_hint_weight=EXPAND_BOTH) | 25 | video = Video(win, size_hint_weight=EXPAND_BOTH) |
39 | win.resize_object_add(video) | ||
40 | video.show() | ||
41 | 26 | ||
42 | player = Player(win, content=video) | 27 | player = Player(win, content=video, size_hint_weight=EXPAND_BOTH) |
28 | win.resize_object_add(player) | ||
43 | player.show() | 29 | player.show() |
44 | 30 | ||
45 | notify = Notify(win, orient=ELM_NOTIFY_ORIENT_BOTTOM, timeout=3.0) | ||
46 | notify.content = player | ||
47 | |||
48 | tb = Table(win, size_hint_weight=EXPAND_BOTH) | 31 | tb = Table(win, size_hint_weight=EXPAND_BOTH) |
49 | win.resize_object_add(tb) | 32 | win.resize_object_add(tb) |
33 | tb.show() | ||
50 | 34 | ||
51 | bt = FileselectorButton(win, text="Select Video", | 35 | bt = FileselectorButton(win, text="Select Video", |
52 | size_hint_weight=EXPAND_BOTH, size_hint_align=(0.5, 0.1)) | 36 | size_hint_weight=EXPAND_BOTH, |
37 | size_hint_align=(0.5, 0.1)) | ||
53 | bt.callback_file_chosen_add(my_bt_open, video) | 38 | bt.callback_file_chosen_add(my_bt_open, video) |
54 | tb.pack(bt, 0, 0, 1, 1) | 39 | tb.pack(bt, 0, 0, 1, 1) |
55 | bt.show() | 40 | bt.show() |
56 | 41 | ||
57 | tb.show() | ||
58 | |||
59 | video.event_callback_add(EVAS_CALLBACK_MOUSE_MOVE, notify_show, notify) | ||
60 | video.event_callback_add(EVAS_CALLBACK_MOUSE_IN, notify_block, notify) | ||
61 | video.event_callback_add(EVAS_CALLBACK_MOUSE_OUT, notify_unblock, notify) | ||
62 | |||
63 | win.show() | 42 | win.show() |
64 | 43 | ||
65 | 44 | ||