From 2c51e6c6322585c946bea0b0e8b39526d2b29eb4 Mon Sep 17 00:00:00 2001 From: Paulus Date: Sun, 19 Oct 2008 19:33:58 +0000 Subject: [PATCH] Initial import git-svn-id: http://www.neo1973-germany.de/svn@197 46df4e5c-bc4e-4628-a0fc-830ba316316d --- auxmenu/trunk/auxmenu.edc | 583 ++++++++++++++++++++++++++++++++++++++ auxmenu/trunk/auxmenu.edj | Bin 0 -> 9380 bytes auxmenu/trunk/auxmenu.py | 130 +++++++++ 3 files changed, 713 insertions(+) create mode 100644 auxmenu/trunk/auxmenu.edc create mode 100644 auxmenu/trunk/auxmenu.edj create mode 100644 auxmenu/trunk/auxmenu.py diff --git a/auxmenu/trunk/auxmenu.edc b/auxmenu/trunk/auxmenu.edc new file mode 100644 index 0000000..a1d98b9 --- /dev/null +++ b/auxmenu/trunk/auxmenu.edc @@ -0,0 +1,583 @@ +collections { + group { + name, "main"; + min, 480 640; + max, 1024 768; + + parts { +#define COLOR_DEFAULT 30 30 30 255 +#define COLOR_CLICKED 80 80 80 255 + part { + name, "background"; + type, RECT; + mouse_events, 0; + + description { + state, "default" 0.0; + min, 480 640; + max, 1024 768; + color, 200 200 200 200; + rel1 { + relative, 0.0 0.0; + offset, 0 0; + } + rel2 { + relative, 1.0 1.0; + offset, -1 -1; + } + } + } + + part { + name, "button_mute"; + type, RECT; + mouse_events, 1; + + description { + state, "default" 0.0; + min, 400 80; + max, 400 80; + align, 0.5 0.5; + + color, COLOR_DEFAULT; + + rel1 { + relative, 0.0 0.0; + offset, 0 0; + } + rel2 { + relative, 1.0 0.15; + offset, 0 0; + } + } + description { + state, "clicked" 0.0; + min, 400 80; + max, 400 80; + align, 0.5 0.5; + + color, COLOR_CLICKED; + + rel1 { + relative, 0.0 0.0; + offset, 0 0; + } + rel2 { + relative, 1.0 0.15; + offset, 0 0; + } + } + } + part { + name, "button_snapshot"; + type, RECT; + mouse_events, 1; + + description { + state, "default" 0.0; + min, 400 80; + max, 400 80; + align, 0.5 0.5; + + color, COLOR_DEFAULT; + + rel1 { + relative, 0.0 0.15; + offset, 0 0; + } + rel2 { + relative, 1.0 0.3; + offset, 0 0; + } + } + description { + state, "clicked" 0.0; + min, 400 80; + max, 400 80; + align, 0.5 0.5; + + color, COLOR_CLICKED; + + rel1 { + relative, 0.0 0.15; + offset, 0 0; + } + rel2 { + relative, 1.0 0.3; + offset, 0 0; + } + } + } + part { + name, "button_lock"; + type, RECT; + mouse_events, 1; + + description { + state, "default" 0.0; + min, 400 80; + max, 400 80; + align, 0.5 0.5; + + color, COLOR_DEFAULT; + + rel1 { + relative, 0.0 0.3; + offset, 0 0; + } + rel2 { + relative, 1.0 0.45; + offset, 0 0; + } + } + description { + state, "clicked" 0.0; + min, 400 80; + max, 400 80; + align, 0.5 0.5; + + color, COLOR_CLICKED; + + rel1 { + relative, 0.0 0.3; + offset, 0 0; + } + rel2 { + relative, 1.0 0.45; + offset, 0 0; + } + } + } + part { + name, "button_standby"; + type, RECT; + mouse_events, 1; + + description { + state, "default" 0.0; + min, 400 80; + max, 400 80; + align, 0.5 0.5; + + color, COLOR_DEFAULT; + + rel1 { + relative, 0.0 0.45; + offset, 0 0; + } + rel2 { + relative, 1.0 0.6; + offset, 0 0; + } + } + description { + state, "clicked" 0.0; + min, 400 80; + max, 400 80; + align, 0.5 0.5; + + color, COLOR_CLICKED; + + rel1 { + relative, 0.0 0.45; + offset, 0 0; + } + rel2 { + relative, 1.0 0.6; + offset, 0 0; + } + } + } + part { + name, "button_shutdown"; + type, RECT; + mouse_events, 1; + + description { + state, "default" 0.0; + min, 400 80; + max, 400 80; + align, 0.5 0.5; + + color, COLOR_DEFAULT; + + rel1 { + relative, 0.0 0.6; + offset, 0 0; + } + rel2 { + relative, 1.0 0.75; + offset, 0 0; + } + } + description { + state, "clicked" 0.0; + min, 400 80; + max, 400 80; + align, 0.5 0.5; + + color, COLOR_CLICKED; + + rel1 { + relative, 0.0 0.6; + offset, 0 0; + } + rel2 { + relative, 1.0 0.75; + offset, 0 0; + } + } + } + part { + name, "button_exit"; + type, RECT; + mouse_events, 1; + + description { + state, "default" 0.0; + min, 400 80; + max, 400 80; + align, 0.5 0.5; + + color, COLOR_DEFAULT; + + rel1 { + relative, 0.0 0.75; + offset, 0 0; + } + rel2 { + relative, 1.0 1.0; + offset, 0 0; + } + } + description { + state, "clicked" 0.0; + min, 400 80; + max, 400 80; + align, 0.5 0.5; + + color, COLOR_CLICKED; + + rel1 { + relative, 0.0 0.75; + offset, 0 0; + } + rel2 { + relative, 1.0 1.0; + offset, 0 0; + } + } + } + part { + name, "text_mute"; + type, TEXT; + mouse_events, 0; + + description { + state, "default" 0.0; + + rel1 { + + relative, 0.0 0.0; + offset, 0 0; + to, "button_mute"; + } + rel2 { + relative, 1.0 1.0; + offset, -1 -1; + to, "button_mute"; + } + text { + text, "(UN-)MUTE"; + font, "sans serif"; + size, 26; + align, 0.5 0.5; + } + } + } + part { + name, "text_snapshot"; + type, TEXT; + mouse_events, 0; + + description { + state, "default" 0.0; + + rel1 { + + relative, 0.0 0.0; + offset, 0 0; + to, "button_snapshot"; + } + rel2 { + relative, 1.0 1.0; + offset, -1 -1; + to, "button_snapshot"; + } + text { + text, "SNAPSHOT"; + font, "sans serif"; + size, 26; + align, 0.5 0.5; + } + } + } + part { + name, "text_lock"; + type, TEXT; + mouse_events, 0; + + description { + state, "default" 0.0; + + rel1 { + + relative, 0.0 0.0; + offset, 0 0; + to, "button_lock"; + } + rel2 { + relative, 1.0 1.0; + offset, -1 -1; + to, "button_lock"; + } + text { + text, "LOCK"; + font, "sans serif"; + size, 26; + align, 0.5 0.5; + } + } + } + part { + name, "text_standby"; + type, TEXT; + mouse_events, 0; + + description { + state, "default" 0.0; + + rel1 { + + relative, 0.0 0.0; + offset, 0 0; + to, "button_standby"; + } + rel2 { + relative, 1.0 1.0; + offset, -1 -1; + to, "button_standby"; + } + text { + text, "STANDBY"; + font, "sans serif"; + size, 26; + align, 0.5 0.5; + } + } + } + part { + name, "text_shutdown"; + type, TEXT; + mouse_events, 0; + + description { + state, "default" 0.0; + + rel1 { + + relative, 0.0 0.0; + offset, 0 0; + to, "button_shutdown"; + } + rel2 { + relative, 1.0 1.0; + offset, -1 -1; + to, "button_shutdown"; + } + text { + text, "SHUTDOWN"; + font, "sans serif"; + size, 26; + align, 0.5 0.5; + } + } + } + part { + name, "text_exit"; + type, TEXT; + mouse_events, 0; + + description { + state, "default" 0.0; + + rel1 { + + relative, 0.0 0.0; + offset, 0 0; + to, "button_exit"; + } + rel2 { + relative, 1.0 1.0; + offset, -1 -1; + to, "button_exit"; + } + text { + text, "EXIT"; + font, "sans serif"; + size, 26; + align, 0.5 0.5; + } + } + } + + } /* Close Parts */ + + programs { + program { + name, "mute_click"; + signal, "mouse,down,1"; + source, "button_mute"; + action, STATE_SET "clicked" 0.0; + target, "button_mute"; + } + + program { + name, "mute_unclick"; + signal, "mouse,up,1"; + source, "button_mute"; + action, STATE_SET "default" 0.0; + target, "button_mute"; + } + + program { + name, "mute_signal"; + signal, "mouse,down,1"; + source, "button_mute"; + action, SIGNAL_EMIT "mute" "button"; + in, 0.0 0.0; + } +//snapshot + program { + name, "snapshot_click"; + signal, "mouse,down,1"; + source, "button_snapshot"; + action, STATE_SET "clicked" 0.0; + target, "button_snapshot"; + } + + program { + name, "snapshot_unclick"; + signal, "mouse,up,1"; + source, "button_snapshot"; + action, STATE_SET "default" 0.0; + target, "button_snapshot"; + } + + program { + name, "snapshot_signal"; + signal, "mouse,down,1"; + source, "button_snapshot"; + action, SIGNAL_EMIT "snapshot" "button"; + in, 0.0 0.0; + } +//lock + program { + name, "lock_click"; + signal, "mouse,down,1"; + source, "button_lock"; + action, STATE_SET "clicked" 0.0; + target, "button_lock"; + } + + program { + name, "lock_unclick"; + signal, "mouse,up,1"; + source, "button_lock"; + action, STATE_SET "default" 0.0; + target, "button_lock"; + } + + program { + name, "lock_signal"; + signal, "mouse,down,1"; + source, "button_lock"; + action, SIGNAL_EMIT "lock" "button"; + in, 0.0 0.0; + } +//standby + program { + name, "standby_click"; + signal, "mouse,down,1"; + source, "button_standby"; + action, STATE_SET "clicked" 0.0; + target, "button_standby"; + } + + program { + name, "standby_unclick"; + signal, "mouse,up,1"; + source, "button_standby"; + action, STATE_SET "default" 0.0; + target, "button_standby"; + } + + program { + name, "standby_signal"; + signal, "mouse,down,1"; + source, "button_standby"; + action, SIGNAL_EMIT "standby" "button"; + in, 0.0 0.0; + } +//shutdown + program { + name, "shutdown_click"; + signal, "mouse,down,1"; + source, "button_shutdown"; + action, STATE_SET "clicked" 0.0; + target, "button_shutdown"; + } + + program { + name, "shutdown_unclick"; + signal, "mouse,up,1"; + source, "button_shutdown"; + action, STATE_SET "default" 0.0; + target, "button_shutdown"; + } + + program { + name, "shutdown_signal"; + signal, "mouse,down,1"; + source, "button_shutdown"; + action, SIGNAL_EMIT "shutdown" "button"; + in, 0.0 0.0; + } +//exit + program { + name, "exit_click"; + signal, "mouse,down,1"; + source, "button_exit"; + action, STATE_SET "clicked" 0.0; + target, "button_exit"; + } + + program { + name, "exit_unclick"; + signal, "mouse,up,1"; + source, "button_exit"; + action, STATE_SET "default" 0.0; + target, "button_exit"; + } + + program { + name, "exit_signal"; + signal, "mouse,down,1"; + source, "button_exit"; + action, SIGNAL_EMIT "exit" "button"; + in, 0.0 0.0; + } + + } /* Close Prog */ + } /* Close Group */ +} /* Close Coll */ diff --git a/auxmenu/trunk/auxmenu.edj b/auxmenu/trunk/auxmenu.edj new file mode 100644 index 0000000000000000000000000000000000000000..3b9332e3dbe4d3dce5b9cfdbc0030ed68cfdfa3a GIT binary patch literal 9380 zcmaKu30%zE`^Ud=i=t@XZi_7vbE(S>5x2!fa#8k7(==0~X=cn!HKD~`$`Z0C7iA|x zal4jeC%X1*5t6-|2&w<)eCPYkw|V_u|L^Pd%yXXidCvBn=bST+RULk(D5^E2jH2uo zQk4Fm6qQg+Q5|=JnLzX?%IOwG{j`9h{GmG@1vA$2u9KlhLDIp`KpSZ})e81il-ojt zP57Yo!O)&Eg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|&HFqu1`~@BSrZ*_PSG_oe+l#!Y?PP*szc zpSA1k(?TP8{_*y0XZC-avs=*X`JZQsU-G|wIoi~)_D;c~N6*H{pM~8%yZCOKA^*J@ zyKKmb?`=ZzVwauI3VvPw`?=?L>-Xd@J5#-(--8=h+_wMG>znLrm0ZSa<8QfYdA@aU zcgHq2((CTu*nWS~(n-a22IVo`-m4$<&KUSuQ?T$#w+DB=P174TuV6rBQBuw8_n84+ ziK!<_y&QMmiz+;@Yoc#P=(~_dcGmMBe+>>85_qdH(90y(_I1II5d{bB4lcOyIAn0< zHPsun!LrSIS7#>t^k@Np>8x0bqhkigy*ZtlJ!xH`t4HsRdvp7>ANABVEMcJVWnPap z$wv9Zb26=}3^u10E_Am^92TJW@!py1i+?+Q+U=bA%cZuHZ7W?)daW82k*w-zoVzk+ z|KlAi_j!!VKih6r-R`7E_OA{cNRKqQ8h>qdVE@3Hi}y~Kl@(oB#eY+@Se<<5=0+o* zP3}i8=ueMaW1PQE+;@vevc@FVv1~-4bGR(1@FABcFfV_g^?`9CK;W zfRllJSERjKZPI5MR(GNO5_}Todkc1wApDGV7-2ZV}zWV6GU)vS;9+5w%NR^U! z>a$m(`Kf#7UpH)>d{~|5G31H$qFJJ88EN*fRvW7lv%;LMZ@D^zZob~NNU+zla8Eyz zo~tuGS4JNwPWr{i-aLB4YtOyAYP?_EG^o9=c zNV)dY**-%&f{a&WKh@iQY>U+1`KqB{hdm`R*;#0`LOk3(+cIVHiYvnT +license: gpl v2 or later +PyBat is a tool to set usb in host or devices mode aund to set the charging speed. +''' + +import ecore +import ecore.evas +import edje +import sys +import os +import e_dbus +import time +from dbus import SystemBus, Interface + +# Parse command line +from optparse import OptionParser + +def parse_geometry(option, opt, value, parser): + try: + w, h = value.split("x") + w = int(w) + h = int(h) + except Exception, e: + raise optparse.OptionValueError("Invalid format for %s" % option) + parser.values.geometry = (w, h) + +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("-g", "--geometry", type="string", metavar="WxH", + action="callback", callback=parse_geometry, + default=(480, 640), + help="use given window geometry") +op.add_option("-f", "--fps", type="int", default=50, + 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_16"): + f = ecore.evas.SoftwareX11_16 + else: + print "warning: x11-16 is not supported, fallback to x11" + f = ecore.evas.SoftwareX11 + +w, h = options.geometry +ee = f(w=w, h=h) +ee.fullscreen = 1 # not options.no_fullscreen +edje.frametime_set(1.0 / options.fps) + + +# Load and setup UI +ee.title = "auxmenu" +ee.name_class = ("auxmenu", "auxmenu") +canvas = ee.evas +edje_file = os.path.join(os.path.dirname(sys.argv[0]), "auxmenu.edj") + +try: + edje_obj = edje.Edje(canvas, file=edje_file, group="main") +except Exception, e: # should be EdjeLoadError, but it's wrong on python2.5 + raise SystemExit("Failed to load Edje file: %s" % edje_file) + +# resize edje to fit our window, show and remember it for later use +edje_obj.size = canvas.size +edje_obj.show() +ee.data["edje"] = edje_obj + + +# Setup callbacks for resize, keydown and selected item +def resize_cb(ee): + r = ee.evas.rect + ee.data["edje"].size = r.size + +ee.callback_resize = resize_cb + + +def key_down_cb(bg, event, ee): + k = event.key + if k == "Escape": + ecore.main_loop_quit() + if k in ("F6", "f"): + ee.fullscreen = not ee.fullscreen + +edje_obj.on_key_down_add(key_down_cb, ee) + + + +class auxmenuclass: + def __init__(self, edje_obj): + print "init" + + def button_pressed(self, edje_obj, signal, source): + if signal == "mute": + print "mute" + elif signal == "snapshot": + print "snapshot" + os.system("gpe-scap &") + elif signal == "lock": + print "lock" + elif signal == "standby": + print "standby" + os.system("apm -s") + elif signal == "shutdown": + print "shutdown" + os.system("halt") + ecore.main_loop_quit() + + +menu = auxmenuclass(edje_obj) + +edje_obj.signal_callback_add("*", "button", menu.button_pressed) +#edje_obj.signal_callback_add("StopSelected", "*", icon_selected) + + + +# Give focus to object, show window and enter event loop +edje_obj.focus = True +ee.show() + +ecore.main_loop_begin()