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 */
84 Channel *cw; /* chan(Stringpair) */
89 Channel *c1; /* chan(tuple(char*, int) == Stringpair) */
90 Channel *c2; /* chan(tuple(char*, int) == Stringpair) */
95 Channel *cm; /* chan(Mouse) */
98 struct Stringpair /* rune and nrune or byte and nbyte */
107 ulong counter; /* serial no. of mouse event */
112 Mousestate queue[16];
113 int ri; /* read index into queue */
114 int wi; /* write index */
115 ulong counter; /* serial no. of last mouse event we received */
116 ulong lastcounter; /* serial no. of last mouse event sent to client */
117 int lastb; /* last button state we received */
118 uchar qfull; /* filled the queue; no more recording until client comes back */
126 Image *i; /* window image, nil when deleted */
129 Channel *ck; /* chan(char*) */
130 Channel *cctl; /* chan(Wctlmesg)[4] */
131 Channel *conswrite; /* chan(Conswritemesg) */
132 Channel *consread; /* chan(Consreadmesg) */
133 Channel *mouseread; /* chan(Mousereadmesg) */
134 Channel *wctlread; /* chan(Consreadmesg) */
135 Channel *kbdread; /* chan(Consreadmesg) */
136 Channel *complete; /* chan(Completion*) */
137 Channel *gone; /* chan(char*) */
138 uint nr; /* number of runes in window */
139 uint maxr; /* number of runes allocated in r */
152 * Rio once used originwindow, so screenr could be different from i->r.
153 * Now they're always the same but the code doesn't assume so.
155 Rectangle screenr; /* screen coordinates of window */
175 int winborder(Window*, Point);
177 void winshell(void*);
178 Window* wlookid(int);
179 Window* wmk(Image*, Mousectl*, Channel*, Channel*, int);
180 Window* wpointto(Point);
182 void wtopme(Window*);
183 void wbottomme(Window*);
184 char* wcontents(Window*, int*);
185 int wbswidth(Window*, Rune);
186 int wclickmatch(Window*, int, int, int, uint*);
188 int wctlmesg(Window*, int, Rectangle, void*);
189 uint wbacknl(Window*, uint, uint);
190 uint winsert(Window*, Rune*, int, uint);
191 void waddraw(Window*, Rune*, int);
192 void wborder(Window*, int);
193 void wclunk(Window*);
194 void wclosewin(Window*);
195 void wcurrent(Window*);
197 void wdelete(Window*, uint, uint);
198 void wdoubleclick(Window*, uint*, uint*);
200 void wframescroll(Window*, int);
201 void wkeyctl(Window*, Rune);
202 void wmousectl(Window*);
203 void wmovemouse(Window*, Point);
204 void wpaste(Window*);
205 void wplumb(Window*);
207 void wrefresh(Window*);
208 void wrepaint(Window*);
209 void wresize(Window*, Image*);
210 void wscrdraw(Window*);
211 void wscroll(Window*, int);
212 void wselect(Window*);
213 void wsendctlmesg(Window*, int, Rectangle, void*);
214 void wsetcursor(Window*, int);
215 void wsetname(Window*);
216 void wsetorigin(Window*, uint, int);
217 void wsetpid(Window*, int, int);
218 void wsetselect(Window*, uint, uint);
219 void wshow(Window*, uint);
220 void wsnarf(Window*);
221 void wscrsleep(Window*, uint);
222 void wsetcols(Window*, int);
252 Channel *c; /* chan(void(*)(Xfid*)) */
256 int flushtag; /* our tag, so flush can find us */
257 Channel *flushc; /* channel(int) to notify us we're being flushed */
260 Channel* xfidinit(void);
262 void xfidflush(Xfid*);
263 void xfidattach(Xfid*);
264 void xfidopen(Xfid*);
265 void xfidclose(Xfid*);
266 void xfidread(Xfid*);
267 void xfidwrite(Xfid*);
280 Channel *cxfidalloc; /* chan(Xfid*) */
281 Channel *csyncflush; /* chan(int) */
285 Filsys* filsysinit(Channel*);
286 int filsysmount(Filsys*, int);
287 Xfid* filsysrespond(Filsys*, Xfid*, Fcall*, char*);
288 void filsyscancel(Xfid*);
290 void wctlproc(void*);
291 void wctlthread(void*);
293 void deletetimeoutproc(void*);
299 Channel *c; /* chan(int) */
319 Image *lighttitlecol;
326 int reverse; /* there are no pastel paints in the dungeons and dragons world -- rob pike */
329 Window *wkeyboard; /* window of simulated keyboard */
343 Channel* winclosechan;
350 int errorshouldabort;
351 int menuing; /* menu action is pending; waiting for window to be indicated */
352 int snarfversion; /* updated each time it is written */
353 int messagesize; /* negotiated in 9P version setup */