diff options
Diffstat (limited to 'src')
| -rwxr-xr-x | src/YalpClients/EflClient/main.py | 48 | ||||
| -rw-r--r-- | src/YalpClients/EflClient/yalp_gui.edc | 69 |
2 files changed, 117 insertions, 0 deletions
diff --git a/src/YalpClients/EflClient/main.py b/src/YalpClients/EflClient/main.py new file mode 100755 index 0000000..9ee7a09 --- /dev/null +++ b/src/YalpClients/EflClient/main.py @@ -0,0 +1,48 @@ +#!/usr/bin/env python + +import edje +import ecore.evas +import sys +import os +import ecore + +# 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 + +ee = ecore.evas.SoftwareX11(w=400, h=400) +edje.frametime_set(1.0 / options.fps) + +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.size = ee.evas.size + +def button_clicked(obj, signal,source): + print "Huhu"; +c.signal_callback_add("mouse,clicked,1","button",button_clicked) + +c.show() +ee.show() +ecore.main_loop_begin(); diff --git a/src/YalpClients/EflClient/yalp_gui.edc b/src/YalpClients/EflClient/yalp_gui.edc new file mode 100644 index 0000000..f895421 --- /dev/null +++ b/src/YalpClients/EflClient/yalp_gui.edc @@ -0,0 +1,69 @@ +collections +{ + group + { + name: "yalp"; + parts + { + part + { + name: "main"; + type: RECT; + mouse_events: 0; + description + { + state: "default" 0.0; + rel1 + { + relative: 0.0 0.0; + offset: 0 0; + } + rel2 + { + relative: 1.0 1.0; + offset: -1 -1; + } + } + } + part + { + name: "button"; + type: RECT; + mouse_events: 1; + + description + { + state: "default" 0.0; + min: 100 50; + max: 100 50; + align: 0.5 0.5; + + color: 211 168 234 255; + + rel1 { + relative, 0.0 0.0; + offset, 0 0; + } + rel2 { + relative, 1.0 1.0; + offset, -1 -1; + } + } + description { + state, "clicked" 0.0; + min, 100 50; + max, 100 50; + align, 0.5 0.5; + color, 170 89 214 255; + rel1 { + relative, 0.0 0.0; + offset, 0 0; + } + rel2 { + relative, 1.0 1.0; + offset, -1 -1; + } + } +} + + |
