From eccb144a715d348076904da1a1890ec71f8d6d7f Mon Sep 17 00:00:00 2001 From: aiju Date: Sun, 6 Dec 2015 20:37:18 +0100 Subject: winwatch: l allows label changes --- sys/src/cmd/winwatch.c | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) (limited to 'sys/src') diff --git a/sys/src/cmd/winwatch.c b/sys/src/cmd/winwatch.c index 8a68f1d58..21922f386 100644 --- a/sys/src/cmd/winwatch.c +++ b/sys/src/cmd/winwatch.c @@ -1,6 +1,7 @@ #include #include #include +#include #include #include #include @@ -267,6 +268,53 @@ click(Mouse m) return 1; } +Cursor crosscursor = { + {-7, -7}, + {0x03, 0xC0, 0x03, 0xC0, 0x03, 0xC0, 0x03, 0xC0, + 0x03, 0xC0, 0x03, 0xC0, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0x03, 0xC0, 0x03, 0xC0, + 0x03, 0xC0, 0x03, 0xC0, 0x03, 0xC0, 0x03, 0xC0, }, + {0x00, 0x00, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, + 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x7F, 0xFE, + 0x7F, 0xFE, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, + 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x00, 0x00, } +}; + +void +chlabel(void) +{ + Mouse m; + char buf[512], fname[128]; + int i, n, fd; + + esetcursor(&crosscursor); + do + m = emouse(); + while((m.buttons & 7) == 0); + do + m = emouse(); + while((m.buttons & 7) == 1); + esetcursor(nil); + if((m.buttons & 7) != 0) + return; + for(i=0; i