mirror of
https://github.com/9fans/plan9port.git
synced 2025-01-12 11:10:07 +00:00
ba31102633
R=rsc CC=plan9port.codebot http://codereview.appspot.com/6346079
42 lines
509 B
Text
42 lines
509 B
Text
fn newwindow {
|
|
winctl=`{9p read acme/new/ctl}
|
|
winid=$winctl(1)
|
|
}
|
|
|
|
fn winctl {
|
|
echo $* | 9p write acme/$winid/ctl
|
|
}
|
|
|
|
fn winread {
|
|
9p read acme/$winid/$1
|
|
}
|
|
|
|
fn winwrite {
|
|
9p write acme/$winid/$1
|
|
}
|
|
|
|
fn windump {
|
|
if(! ~ $1 - '')
|
|
winctl dumpdir $1
|
|
if(! ~ $2 - '')
|
|
winctl dump $2
|
|
}
|
|
|
|
fn winname {
|
|
winctl name $1
|
|
}
|
|
|
|
fn winwriteevent {
|
|
echo $1$2$3 $4 | winwrite event
|
|
}
|
|
|
|
fn windel {
|
|
if(~ $1 sure)
|
|
winctl delete
|
|
if not
|
|
winctl del
|
|
}
|
|
|
|
fn wineventloop {
|
|
. <{winread event >[2]/dev/null | acmeevent}
|
|
}
|