diff options
| -rwxr-xr-x | src/YalpClients/EflClient/main.py | 141 | ||||
| -rw-r--r-- | src/YalpClients/EflClient/yalp_gui.edc | 94 |
2 files changed, 124 insertions, 111 deletions
diff --git a/src/YalpClients/EflClient/main.py b/src/YalpClients/EflClient/main.py index de731e9..4837129 100755 --- a/src/YalpClients/EflClient/main.py +++ b/src/YalpClients/EflClient/main.py @@ -9,93 +9,108 @@ import emotion import evas import elementary -# Parse command line -#from optparse import OptionParser - -"""usage = "usage: %prog [options]" -op = OptionParser(usage=usage) -op.add_option("-e", "--engine", type="choice", choices=("x11", "x11-16"), - default="x11-16", - help=("which display engine to use (x11, x11-16)," "default=%default")) -op.add_option("-n", "--no-fullscreen", action="store_true", - help="do not launch in fullscreen") -op.add_option("-f", "--fps", type="int", default=20, - help="frames per second to use, default=%default") - -""" # Handle options and create output window -"""options, args = op.parse_args() -if options.engine == "x11": - f = ecore.evas.SoftwareX11 -elif options.engine == "x11-16": - if ecore.evas.engine_type_supported_get("software_x11"): - f = ecore.evas.SoftwareX11_16 - else: - print "warning: x11-16 is not supported, fallback to x11" - f = ecore.evas.SoftwareX11 -""" +elementary.init() +win = elementary.Window("Yalp", elementary.ELM_WIN_BASIC) +edje_file = os.path.join(os.path.dirname(sys.argv[0]),"yalp_gui.edj") +c = edje.Edje(win.canvas, file=edje_file, group = "yalp") -def huhu(obj, it, xy): - print "guck guck" +def huhu(obj, str, x): + print "guck guck" -def button_clicked(obj, signal,source): +def findbutton_clicked(obj, signal,source): print "Huhu"; - c.signal_callback_add("mouse,clicked,1","findbutton",button_clicked) -def gui(): - elementary.init() - win = elementary.Window("Yalp", elementary.ELM_WIN_BASIC) +def fill_playlist(obj, str, x): + playlist = elementary.List(win); + playlist.size_hint_weight_set(1.0, 1.0) + playlist.size_hint_align_set(-1.0, -1.0) - edje_file = os.path.join(os.path.dirname(sys.argv[0]),"yalp_gui.edj") - #c = edje.Edje(ee.evas,file=edje_file,group="yalp") - c = edje.Edje(win.canvas, file=edje_file, group = "yalp") - #c.size = ee.evas.size - #c.size = win.canvas.size - - items = [("huhu",huhu), - ("haha", huhu), - ("hoho", huhu), - ("hehe", huhu), - ("hihi", huhu), - ("12345", huhu), - ("abcde", huhu), - ("fghij", huhu), - ("klmno", huhu), - ("pqrst", huhu), - ("uvwxyz", huhu)] - - #ee = ecore.evas.SoftwareX11(w=800, h=600) - win.title_set("YALP") - #edje.frametime_set(1.0 / options.fps) + box1 = elementary.Box(win) + win.resize_object_add(box1) + c.part_swallow("playlist", playlist) + + box1.pack_end(playlist) + playlist.show() + + playlist.item_append(str, None, None, None) + + playlist.go() + box1.show() + +def fill_medialist(): + items = [("huhu", fill_playlist), + ("haha", fill_playlist), + ("hoho", fill_playlist), + ("hehe", fill_playlist), + ("hihi", fill_playlist), + ("12345", huhu), + ("abcde", huhu), + ("fghij", huhu), + ("klmno", huhu), + ("pqrst", huhu), + ("uvwxyz", huhu)] medialist = elementary.List(win); medialist.size_hint_weight_set(1.0, 1.0) medialist.size_hint_align_set(-1.0, -1.0) - + box0 = elementary.Box(win) win.resize_object_add(box0) c.part_swallow("medialist", medialist) - + box0.pack_end(medialist) - medialist.show(); + medialist.show() for item in items: - print item[0] - medialist.item_append(item[0], None, None, item[1]); - - medialist.go(); + #print item[0] + medialist.item_append(item[0], None, None, item[1]) + + medialist.go() + box0.show() +def paint_buttons(): + addbutton = elementary.Button(win) + addbutton.label_set("Add to Playlist") + c.part_swallow("medialist_buttonframe", addbutton) + addbutton.show() + + playbutton = elementary.Button(win) + playbutton.label_set("Play") + c.part_swallow("playlist_buttonframe", playbutton) + c.signal_callback_add("mouse,clicked,1","playlist_buttonframe", + playbutton_clicked) + playbutton.show() + +def playbutton_clicked(obj, signal, source): + play_video() + +def play_video(): vid = emotion.Emotion(win.canvas,module_filename="xine"); - vid.file_set("/home/manut/Videos/2009-2.avi"); - + vid.file_set("Lordi.mpg"); + c.part_swallow("video", vid) - vid.show() vid.play = True +def gui(): + #elementary.init() + #win = elementary.Window("Yalp", elementary.ELM_WIN_BASIC) + global win + global c + win.title_set("YALP") + + #edje_file = os.path.join(os.path.dirname(sys.argv[0]),"yalp_gui.edj") + #c = edje.Edje(win.canvas, file=edje_file, group = "yalp") + c.signal_callback_add("mouse,clicked,1","findbutton",findbutton_clicked) + + paint_buttons() + + fill_medialist() + #play_video() + c.show() win.resize(800,600) - box0.show() win.show() #ecore.main_loop_begin(); elementary.run(); diff --git a/src/YalpClients/EflClient/yalp_gui.edc b/src/YalpClients/EflClient/yalp_gui.edc index 2f20f66..3ad1132 100644 --- a/src/YalpClients/EflClient/yalp_gui.edc +++ b/src/YalpClients/EflClient/yalp_gui.edc @@ -107,7 +107,7 @@ collections } rel2 { - relative: 0.49 1.0; + relative: 0.49 0.8; offset: 0 0; } } @@ -132,8 +132,43 @@ collections part { + name: "playlist_buttonframe"; + type: SWALLOW; + mouse_events: 1; + description + { + state: "default" 0.0; + align: 0 0; + color: 30 89 114 150; + rel1 + { + relative: 0.66 0.85; + } + rel2 + { + relative: 0.86 0.9; + } + } + description + { + state: "default" 1.0; + align: 0 0; + color: 0 0 0 0; + rel1 + { + relative: 1.0 0.85; + } + rel2 + { + relative: 1.0 0.9; + } + } + } + + part + { name: "playlist"; - type: RECT; + type: SWALLOW; mouse_events: 1; description { @@ -147,7 +182,7 @@ collections } rel2 { - relative: 1.0 1.0; + relative: 1.0 0.8; offset: 0 0; } } @@ -158,7 +193,7 @@ collections color: 0 0 0 0; rel1 { - relative: 0.995 0.01; + relative: 1.0 0.01; offset: 0 0; } rel2 @@ -286,13 +321,13 @@ collections part { - name: "add_button"; - type: RECT; + name: "medialist_buttonframe"; + type: SWALLOW; mouse_events: 1; description { state: "default" 0.0; - color: 211 168 234 255; + color: 30 89 114 175; rel1 { relative: 0.15 0.85; @@ -314,49 +349,12 @@ collections } rel2 { - relative: 0.005 0.9; - } - } - } - - part - { - name: "buttontext_add"; - type: TEXT; - mouse_events: 0; - description - { - color: 255 255 255 255; - rel1 - { - relative: 0.17 0.86; - } - rel2 - { - relative: 0.33 0.89 ; - } - text - { - text: "Add to Playlist"; - font:"VeraBd.ttf"; - size: 12; - } - } - description - { - state: "default" 1.0; - rel1 - { - relative: 0.0 0.85; - } - rel2 - { - relative: 0.0 0.9; + relative: -0.5 0.9; } } } - } + programs { program @@ -366,13 +364,13 @@ collections signal: "mouse,clicked,1"; action: STATE_SET "default" 1.0; target: "searchframe"; + target: "medialist_buttonframe"; + target: "playlist_buttonframe"; target: "findbutton"; target: "buttontext_find"; target: "medialist"; target: "playlist"; - target: "add_button"; target: "controlframe"; - target: "buttontext_add"; transition:SINUSOIDAL 1; } } |
