3 Qdir, /* /dev for this window */
20 Qwsys, /* directory of window directories */
21 Qwsysdir, /* window directory, child of wsys */
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 */
83 Channel *cw; /* chan(Stringpair) */
88 Channel *c1; /* chan(tuple(char*, int) == Stringpair) */
89 Channel *c2; /* chan(tuple(char*, int) == Stringpair) */
94 Channel *cm; /* chan(Mouse) */
99 Channel *ck; /* chan(char*) */
102 struct Stringpair /* rune and nrune or byte and nbyte */
111 ulong counter; /* serial no. of mouse event */
116 Mousestate queue[16];
117 int ri; /* read index into queue */
118 int wi; /* write index */
119 ulong counter; /* serial no. of last mouse event we received */
120 ulong lastcounter; /* serial no. of last mouse event sent to client */
121 int lastb; /* last button state we received */
122 uchar qfull; /* filled the queue; no more recording until client comes back */
133 Channel *ck; /* chan(char*) */
134 Channel *cctl; /* chan(Wctlmesg)[20] */
135 Channel *conswrite; /* chan(Conswritemesg) */
136 Channel *consread; /* chan(Consreadmesg) */
137 Channel *mouseread; /* chan(Mousereadmesg) */
138 Channel *wctlread; /* chan(Consreadmesg) */
139 Channel *kbdread; /* chan(Kbdreadmesg) */
140 uint nr; /* number of runes in window */
141 uint maxr; /* number of runes allocated in r */
154 * Rio once used originwindow, so screenr could be different from i->r.
155 * Now they're always the same but the code doesn't assume so.
157 Rectangle screenr; /* screen coordinates of window */
178 int winborder(Window*, Point);
180 void winshell(void*);
181 Window* wlookid(int);
182 Window* wmk(Image*, Mousectl*, Channel*, Channel*, int);
183 Window* wpointto(Point);
185 void wtopme(Window*);
186 void wbottomme(Window*);
187 char* wcontents(Window*, int*);
188 int wbswidth(Window*, Rune);
189 int wclickmatch(Window*, int, int, int, uint*);
191 int wctlmesg(Window*, int, Rectangle, Image*);
192 int wctlmesg(Window*, int, Rectangle, Image*);
193 uint wbacknl(Window*, uint, uint);
194 uint winsert(Window*, Rune*, int, uint);
195 void waddraw(Window*, Rune*, int);
196 void wborder(Window*, int);
197 void wclosewin(Window*);
198 void wcurrent(Window*);
200 void wdelete(Window*, uint, uint);
201 void wdoubleclick(Window*, uint*, uint*);
203 void wframescroll(Window*, int);
204 void wkeyctl(Window*, Rune);
205 void wmousectl(Window*);
206 void wmovemouse(Window*, Point);
207 void wpaste(Window*);
208 void wplumb(Window*);
209 void wrefresh(Window*, Rectangle);
210 void wrepaint(Window*);
211 void wresize(Window*, Image*, int);
212 void wscrdraw(Window*);
213 void wscroll(Window*, int);
214 void wselect(Window*);
215 void wsendctlmesg(Window*, int, Rectangle, Image*);
216 void wsetcursor(Window*, int);
217 void wsetname(Window*);
218 void wsetorigin(Window*, uint, int);
219 void wsetpid(Window*, int, int);
220 void wsetselect(Window*, uint, uint);
221 void wshow(Window*, uint);
222 void wsnarf(Window*);
223 void wscrsleep(Window*, uint);
224 void wsetcols(Window*);
254 Channel *c; /* chan(void(*)(Xfid*)) */
259 int flushing; /* another Xfid is trying to flush us */
260 int flushtag; /* our tag, so flush can find us */
261 Channel *flushc; /* channel(int) to notify us we're being flushed */
264 Channel* xfidinit(void);
266 void xfidflush(Xfid*);
267 void xfidattach(Xfid*);
268 void xfidopen(Xfid*);
269 void xfidclose(Xfid*);
270 void xfidread(Xfid*);
271 void xfidwrite(Xfid*);
284 Channel *cxfidalloc; /* chan(Xfid*) */
288 Filsys* filsysinit(Channel*);
289 int filsysmount(Filsys*, int);
290 Xfid* filsysrespond(Filsys*, Xfid*, Fcall*, char*);
291 void filsyscancel(Xfid*);
293 void wctlproc(void*);
294 void wctlthread(void*);
296 void deletetimeoutproc(void*);
302 Channel *c; /* chan(int) */
322 Window *wkeyboard; /* window of simulated keyboard */
334 Channel* winclosechan;
341 int errorshouldabort;
342 int menuing; /* menu action is pending; waiting for window to be indicated */
343 int snarfversion; /* updated each time it is written */
344 int messagesize; /* negotiated in 9P version setup */