diff options
author | Russ Cox <rsc@swtch.com> | 2020-05-18 23:45:03 -0400 |
---|---|---|
committer | Russ Cox <rsc@swtch.com> | 2020-05-18 23:45:03 -0400 |
commit | d25d0ca1a3682d97df67f62789767562aa5bf1b3 (patch) | |
tree | 95e736b3189ffd5dbb74fb74c41eb8ac450de8f5 /src/libdraw/drawfcall.c | |
parent | b4cc38f94321c71e8d19fbbd4691e72f7c0d817b (diff) | |
download | plan9port-d25d0ca1a3682d97df67f62789767562aa5bf1b3.tar.gz plan9port-d25d0ca1a3682d97df67f62789767562aa5bf1b3.tar.bz2 plan9port-d25d0ca1a3682d97df67f62789767562aa5bf1b3.zip |
devdraw, libdraw: handle keyboard runes > U+FFFF
Runes in Plan 9 were limited to the 16-bit BMP when I drew up
the RPC protocol between graphical programs and devdraw
a long time ago. Now that they can be 32-bit, use a 32-bit wire
encoding too. A new message number to avoid problems with
other clients (like 9fans.net/go).
Add keyboard shortcut alt : , for U+1F602, face with tears of joy,
to test that it all works.
Diffstat (limited to 'src/libdraw/drawfcall.c')
-rw-r--r-- | src/libdraw/drawfcall.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/libdraw/drawfcall.c b/src/libdraw/drawfcall.c index eea14095..94115384 100644 --- a/src/libdraw/drawfcall.c +++ b/src/libdraw/drawfcall.c @@ -50,6 +50,7 @@ sizeW2M(Wsysmsg *m) case Rcursor: case Rcursor2: case Trdkbd: + case Trdkbd4: case Rlabel: case Rctxt: case Rinit: @@ -73,6 +74,8 @@ sizeW2M(Wsysmsg *m) return 4+1+1+_stringsize(m->error); case Rrdkbd: return 4+1+1+2; + case Rrdkbd4: + return 4+1+1+4; case Tlabel: return 4+1+1+_stringsize(m->label); case Tctxt: @@ -117,6 +120,7 @@ convW2M(Wsysmsg *m, uchar *p, uint n) case Rcursor: case Rcursor2: case Trdkbd: + case Trdkbd4: case Rlabel: case Rctxt: case Rinit: @@ -166,6 +170,9 @@ convW2M(Wsysmsg *m, uchar *p, uint n) case Rrdkbd: PUT2(p+6, m->rune); break; + case Rrdkbd4: + PUT(p+6, m->rune); + break; case Tlabel: PUTSTRING(p+6, m->label); break; @@ -221,6 +228,7 @@ convM2W(uchar *p, uint n, Wsysmsg *m) case Rcursor: case Rcursor2: case Trdkbd: + case Trdkbd4: case Rlabel: case Rctxt: case Rinit: @@ -270,6 +278,9 @@ convM2W(uchar *p, uint n, Wsysmsg *m) case Rrdkbd: GET2(p+6, m->rune); break; + case Rrdkbd4: + GET(p+6, m->rune); + break; case Tlabel: GETSTRING(p+6, &m->label); break; @@ -360,6 +371,10 @@ drawfcallfmt(Fmt *fmt) return fmtprint(fmt, "Trdkbd"); case Rrdkbd: return fmtprint(fmt, "Rrdkbd rune=%C", m->rune); + case Trdkbd4: + return fmtprint(fmt, "Trdkbd4"); + case Rrdkbd4: + return fmtprint(fmt, "Rrdkbd4 rune=%C", m->rune); case Tlabel: return fmtprint(fmt, "Tlabel label='%s'", m->label); case Rlabel: |