3 Qdir, /* /dev for this window */
20 Qwsys, /* directory of window directories */
21 Qwsysdir, /* window directory, child of wsys */
27 #define MAXSNARF 100*1024
29 typedef struct Consreadmesg Consreadmesg;
30 typedef struct Conswritemesg Conswritemesg;
31 typedef struct Kbdreadmesg Kbdreadmesg;
32 typedef struct Stringpair Stringpair;
33 typedef struct Dirtab Dirtab;
34 typedef struct Fid Fid;
35 typedef struct Filsys Filsys;
36 typedef struct Mouseinfo Mouseinfo;
37 typedef struct Mousereadmesg Mousereadmesg;
38 typedef struct Mousestate Mousestate;
39 typedef struct Ref Ref;
40 typedef struct Timer Timer;
41 typedef struct Wctlmesg Wctlmesg;
42 typedef struct Window Window;
43 typedef struct Xfid Xfid;
47 Selborder = 4, /* border of selected window */
48 Unselborder = 1, /* border of unselected window */
49 Scrollwid = 12, /* width of scroll bar */
50 Scrollgap = 4, /* gap right of scroll bar */
51 BIG = 3, /* factor by which window dimension can exceed screen */
56 #define QID(w,q) ((w<<8)|(q))
57 #define WIN(q) ((((ulong)(q).path)>>8) & 0xFFFFFF)
58 #define FILE(q) (((ulong)(q).path) & 0xFF)
60 enum /* control messages */
86 Channel *cw; /* chan(Stringpair) */
91 Channel *c1; /* chan(tuple(char*, int) == Stringpair) */
92 Channel *c2; /* chan(tuple(char*, int) == Stringpair) */
97 Channel *cm; /* chan(Mouse) */
102 Channel *ck; /* chan(char*) */
105 struct Stringpair /* rune and nrune or byte and nbyte */
114 ulong counter; /* serial no. of mouse event */
119 Mousestate queue[16];
120 int ri; /* read index into queue */
121 int wi; /* write index */
122 ulong counter; /* serial no. of last mouse event we received */
123 ulong lastcounter; /* serial no. of last mouse event sent to client */
124 int lastb; /* last button state we received */
125 uchar qfull; /* filled the queue; no more recording until client comes back */
133 Image *i; /* window image, nil when deleted */
136 Channel *ck; /* chan(char*) */
137 Channel *cctl; /* chan(Wctlmesg)[4] */
138 Channel *conswrite; /* chan(Conswritemesg) */
139 Channel *consread; /* chan(Consreadmesg) */
140 Channel *mouseread; /* chan(Mousereadmesg) */
141 Channel *wctlread; /* chan(Consreadmesg) */
142 Channel *kbdread; /* chan(Kbdreadmesg) */
143 Channel *complete; /* chan(Completion*) */
144 Channel *gone; /* chan(char*) */
145 uint nr; /* number of runes in window */
146 uint maxr; /* number of runes allocated in r */
159 * Rio once used originwindow, so screenr could be different from i->r.
160 * Now they're always the same but the code doesn't assume so.
162 Rectangle screenr; /* screen coordinates of window */
182 int winborder(Window*, Point);
184 void winshell(void*);
185 Window* wlookid(int);
186 Window* wmk(Image*, Mousectl*, Channel*, Channel*, int);
187 Window* wpointto(Point);
189 void wtopme(Window*);
190 void wbottomme(Window*);
191 char* wcontents(Window*, int*);
192 int wbswidth(Window*, Rune);
193 int wclickmatch(Window*, int, int, int, uint*);
195 int wctlmesg(Window*, int, Rectangle, void*);
196 uint wbacknl(Window*, uint, uint);
197 uint winsert(Window*, Rune*, int, uint);
198 void waddraw(Window*, Rune*, int);
199 void wborder(Window*, int);
200 void wclunk(Window*);
201 void wclosewin(Window*);
202 void wcurrent(Window*);
204 void wdelete(Window*, uint, uint);
205 void wdoubleclick(Window*, uint*, uint*);
207 void wframescroll(Window*, int);
208 void wkeyctl(Window*, Rune);
209 void wmousectl(Window*);
210 void wmovemouse(Window*, Point);
211 void wpaste(Window*);
212 void wplumb(Window*);
213 void wrefresh(Window*, Rectangle);
214 void wrepaint(Window*);
215 void wresize(Window*, Image*, int);
216 void wscrdraw(Window*);
217 void wscroll(Window*, int);
218 void wselect(Window*);
219 void wsendctlmesg(Window*, int, Rectangle, void*);
220 void wsetcursor(Window*, int);
221 void wsetname(Window*);
222 void wsetorigin(Window*, uint, int);
223 void wsetpid(Window*, int, int);
224 void wsetselect(Window*, uint, uint);
225 void wshow(Window*, uint);
226 void wsnarf(Window*);
227 void wscrsleep(Window*, uint);
228 void wsetcols(Window*, int);
258 Channel *c; /* chan(void(*)(Xfid*)) */
262 int flushtag; /* our tag, so flush can find us */
263 Channel *flushc; /* channel(int) to notify us we're being flushed */
266 Channel* xfidinit(void);
268 void xfidflush(Xfid*);
269 void xfidattach(Xfid*);
270 void xfidopen(Xfid*);
271 void xfidclose(Xfid*);
272 void xfidread(Xfid*);
273 void xfidwrite(Xfid*);
286 Channel *cxfidalloc; /* chan(Xfid*) */
287 Channel *csyncflush; /* chan(int) */
291 Filsys* filsysinit(Channel*);
292 int filsysmount(Filsys*, int);
293 Xfid* filsysrespond(Filsys*, Xfid*, Fcall*, char*);
294 void filsyscancel(Xfid*);
296 void wctlproc(void*);
297 void wctlthread(void*);
299 void deletetimeoutproc(void*);
305 Channel *c; /* chan(int) */
325 Image *lighttitlecol;
332 int reverse; /* there are no pastel paints in the dungeons and dragons world -- rob pike */
335 Window *wkeyboard; /* window of simulated keyboard */
348 Channel* winclosechan;
355 int errorshouldabort;
356 int menuing; /* menu action is pending; waiting for window to be indicated */
357 int snarfversion; /* updated each time it is written */
358 int messagesize; /* negotiated in 9P version setup */