aboutsummaryrefslogtreecommitdiff
path: root/include/drawfcall.h
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2006-06-26 00:08:29 +0000
committerrsc <devnull@localhost>2006-06-26 00:08:29 +0000
commit9801d5e566203cb283488deefd6dff5382194c0e (patch)
tree82f1b38f5421bfde4fe8557606f013f38378aee2 /include/drawfcall.h
parent56b2179d995dff3750de2ddcebb255f52281afe6 (diff)
downloadplan9port-9801d5e566203cb283488deefd6dff5382194c0e.tar.gz
plan9port-9801d5e566203cb283488deefd6dff5382194c0e.tar.bz2
plan9port-9801d5e566203cb283488deefd6dff5382194c0e.zip
forgot
Diffstat (limited to 'include/drawfcall.h')
-rw-r--r--include/drawfcall.h124
1 files changed, 124 insertions, 0 deletions
diff --git a/include/drawfcall.h b/include/drawfcall.h
new file mode 100644
index 00000000..e8a8c9b2
--- /dev/null
+++ b/include/drawfcall.h
@@ -0,0 +1,124 @@
+/* Copyright (c) 2006 Russ Cox */
+
+/*
+
+tag[1] Rerror error[s]
+
+tag[1] Trdmouse
+tag[1] Rrdmouse x[4] y[4] button[4] msec[4] resized[1]
+
+tag[1] Tmoveto x[4] y[4]
+tag[1] Rmoveto
+
+tag[1] Tcursor cursor[]
+tag[1] Rcursor
+
+tag[1] Tbouncemouse x[4] y[4] button[4]
+tag[1] Rbouncemouse
+
+tag[1] Trdkbd
+tag[1] Rrdkbd rune[2]
+
+tag[1] Tlabel label[s]
+tag[1] Rlabel
+
+tag[1] Tinit winsize[s] label[s] font[s]
+tag[1] Rinit
+
+tag[1] Trdsnarf
+tag[1] Rrdsnarf snarf[s]
+
+tag[1] Twrsnarf snarf[s]
+tag[1] Rwrsnarf
+
+tag[1] Trddraw count[4]
+tag[1] Rrddraw count[4] data[count]
+
+tag[1] Twrdraw count[4] data[count]
+tag[1] Rwrdraw count[4]
+
+tag[1] Ttop
+tag[1] Rtop
+
+tag[1] Tresize rect[4*4]
+tag[1] Rresize
+*/
+
+AUTOLIB(draw)
+
+#define PUT(p, x) \
+ (p)[0] = ((x) >> 24)&0xFF, \
+ (p)[1] = ((x) >> 16)&0xFF, \
+ (p)[2] = ((x) >> 8)&0xFF, \
+ (p)[3] = (x)&0xFF
+
+#define GET(p, x) \
+ ((x) = (((p)[0] << 24) | ((p)[1] << 16) | ((p)[2] << 8) | ((p)[3])))
+
+#define PUT2(p, x) \
+ (p)[0] = ((x) >> 8)&0xFF, \
+ (p)[1] = (x)&0xFF
+
+#define GET2(p, x) \
+ ((x) = (((p)[0] << 8) | ((p)[1])))
+
+enum {
+ Rerror = 1,
+ Trdmouse = 2,
+ Rrdmouse,
+ Tmoveto = 4,
+ Rmoveto,
+ Tcursor = 6,
+ Rcursor,
+ Tbouncemouse = 8,
+ Rbouncemouse,
+ Trdkbd = 10,
+ Rrdkbd,
+ Tlabel = 12,
+ Rlabel,
+ Tinit = 14,
+ Rinit,
+ Trdsnarf = 16,
+ Rrdsnarf,
+ Twrsnarf = 18,
+ Rwrsnarf,
+ Trddraw = 20,
+ Rrddraw,
+ Twrdraw = 22,
+ Rwrdraw,
+ Ttop = 24,
+ Rtop,
+ Tresize = 26,
+ Rresize,
+ Tmax,
+};
+
+enum {
+ MAXWMSG = 4*1024*1024
+};
+
+typedef struct Wsysmsg Wsysmsg;
+struct Wsysmsg
+{
+ uchar type;
+ uchar tag;
+ Mouse mouse;
+ int resized;
+ Cursor cursor;
+ int arrowcursor;
+ Rune rune;
+ char *winsize;
+ char *label;
+ char *snarf;
+ char *error;
+ uchar *data;
+ uint count;
+ Rectangle rect;
+};
+
+uint convW2M(Wsysmsg*, uchar*, uint);
+uint convM2W(uchar*, uint, Wsysmsg*);
+uint sizeW2M(Wsysmsg*);
+int readwsysmsg(int, uchar*, uint);
+
+int drawfcallfmt(Fmt*);