3 Qdir, /* /dev for this window */
19 Qwsys, /* directory of window directories */
20 Qwsysdir, /* window directory, child of wsys */
26 #define MAXSNARF 100*1024
28 typedef struct Consreadmesg Consreadmesg;
29 typedef struct Conswritemesg Conswritemesg;
30 typedef struct Kbdreadmesg Kbdreadmesg;
31 typedef struct Stringpair Stringpair;
32 typedef struct Dirtab Dirtab;
33 typedef struct Fid Fid;
34 typedef struct Filsys Filsys;
35 typedef struct Mouseinfo Mouseinfo;
36 typedef struct Mousereadmesg Mousereadmesg;
37 typedef struct Mousestate Mousestate;
38 typedef struct Ref Ref;
39 typedef struct Timer Timer;
40 typedef struct Wctlmesg Wctlmesg;
41 typedef struct Window Window;
42 typedef struct Xfid Xfid;
46 Selborder = 4, /* border of selected window */
47 Unselborder = 1, /* border of unselected window */
48 Scrollwid = 12, /* width of scroll bar */
49 Scrollgap = 4, /* gap right of scroll bar */
50 BIG = 3, /* factor by which window dimension can exceed screen */
55 #define QID(w,q) ((w<<8)|(q))
56 #define WIN(q) ((((ulong)(q).path)>>8) & 0xFFFFFF)
57 #define FILE(q) (((ulong)(q).path) & 0xFF)
59 enum /* control messages */
85 Channel *cw; /* chan(Stringpair) */
90 Channel *c1; /* chan(tuple(char*, int) == Stringpair) */
91 Channel *c2; /* chan(tuple(char*, int) == Stringpair) */
96 Channel *cm; /* chan(Mouse) */
99 struct Stringpair /* rune and nrune or byte and nbyte */
108 ulong counter; /* serial no. of mouse event */
113 Mousestate queue[16];
114 int ri; /* read index into queue */
115 int wi; /* write index */
116 ulong counter; /* serial no. of last mouse event we received */
117 ulong lastcounter; /* serial no. of last mouse event sent to client */
118 int lastb; /* last button state we received */
119 uchar qfull; /* filled the queue; no more recording until client comes back */
127 Image *i; /* window image, nil when deleted */
130 Channel *ck; /* chan(char*) */
131 Channel *cctl; /* chan(Wctlmesg)[4] */
132 Channel *conswrite; /* chan(Conswritemesg) */
133 Channel *consread; /* chan(Consreadmesg) */
134 Channel *mouseread; /* chan(Mousereadmesg) */
135 Channel *wctlread; /* chan(Consreadmesg) */
136 Channel *kbdread; /* chan(Consreadmesg) */
137 Channel *complete; /* chan(Completion*) */
138 Channel *gone; /* chan(char*) */
139 uint nr; /* number of runes in window */
140 uint maxr; /* number of runes allocated in r */
153 * Rio once used originwindow, so screenr could be different from i->r.
154 * Now they're always the same but the code doesn't assume so.
156 Rectangle screenr; /* screen coordinates of window */
178 void winshell(void*);
179 Window* wlookid(int);
180 Window* wmk(Image*, Mousectl*, Channel*, Channel*, int);
181 Window* wpointto(Point);
183 void wtopme(Window*);
184 void wbottomme(Window*);
185 char* wcontents(Window*, int*);
187 uint wbacknl(Window*, uint, uint);
188 void wcurrent(Window*);
189 void wuncurrent(Window*);
191 void wpaste(Window*);
192 void wplumb(Window*);
194 void wscrdraw(Window*);
195 void wscroll(Window*, int);
197 void wsendctlmesg(Window*, int, Rectangle, void*);
198 void wsetcursor(Window*, int);
199 void wsetname(Window*);
200 void wsetorigin(Window*, uint, int);
201 void wsetpid(Window*, int, int);
202 void wshow(Window*, uint);
203 void wsnarf(Window*);
204 void wscrsleep(Window*, uint);
234 Channel *c; /* chan(void(*)(Xfid*)) */
238 int flushtag; /* our tag, so flush can find us */
239 Channel *flushc; /* channel(int) to notify us we're being flushed */
242 Channel* xfidinit(void);
244 void xfidflush(Xfid*);
245 void xfidattach(Xfid*);
246 void xfidopen(Xfid*);
247 void xfidclose(Xfid*);
248 void xfidread(Xfid*);
249 void xfidwrite(Xfid*);
262 Channel *cxfidalloc; /* chan(Xfid*) */
263 Channel *csyncflush; /* chan(int) */
267 Filsys* filsysinit(Channel*);
268 int filsysmount(Filsys*, int);
269 Xfid* filsysrespond(Filsys*, Xfid*, Fcall*, char*);
270 void filsyscancel(Xfid*);
272 void wctlproc(void*);
273 void wctlthread(void*);
275 void deletetimeoutproc(void*);
281 Channel *c; /* chan(int) */
301 Image *lighttitlecol;
308 int reverse; /* there are no pastel paints in the dungeons and dragons world -- rob pike */
311 Window *wkeyboard; /* window of simulated keyboard */
325 Channel* winclosechan;
331 int errorshouldabort;
332 int menuing; /* menu action is pending; waiting for window to be indicated */
333 int snarfversion; /* updated each time it is written */
334 int messagesize; /* negotiated in 9P version setup */