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) */
101 Channel *ck; /* chan(char*) */
104 struct Stringpair /* rune and nrune or byte and nbyte */
113 ulong counter; /* serial no. of mouse event */
118 Mousestate queue[16];
119 int ri; /* read index into queue */
120 int wi; /* write index */
121 ulong counter; /* serial no. of last mouse event we received */
122 ulong lastcounter; /* serial no. of last mouse event sent to client */
123 int lastb; /* last button state we received */
124 uchar qfull; /* filled the queue; no more recording until client comes back */
132 Image *i; /* window image, nil when deleted */
135 Channel *ck; /* chan(char*) */
136 Channel *cctl; /* chan(Wctlmesg)[4] */
137 Channel *conswrite; /* chan(Conswritemesg) */
138 Channel *consread; /* chan(Consreadmesg) */
139 Channel *mouseread; /* chan(Mousereadmesg) */
140 Channel *wctlread; /* chan(Consreadmesg) */
141 Channel *kbdread; /* chan(Kbdreadmesg) */
142 Channel *complete; /* chan(Completion*) */
143 Channel *gone; /* chan(char*) */
144 uint nr; /* number of runes in window */
145 uint maxr; /* number of runes allocated in r */
158 * Rio once used originwindow, so screenr could be different from i->r.
159 * Now they're always the same but the code doesn't assume so.
161 Rectangle screenr; /* screen coordinates of window */
181 int winborder(Window*, Point);
183 void winshell(void*);
184 Window* wlookid(int);
185 Window* wmk(Image*, Mousectl*, Channel*, Channel*, int);
186 Window* wpointto(Point);
188 void wtopme(Window*);
189 void wbottomme(Window*);
190 char* wcontents(Window*, int*);
191 int wbswidth(Window*, Rune);
192 int wclickmatch(Window*, int, int, int, uint*);
194 int wctlmesg(Window*, int, Rectangle, void*);
195 uint wbacknl(Window*, uint, uint);
196 uint winsert(Window*, Rune*, int, uint);
197 void waddraw(Window*, Rune*, int);
198 void wborder(Window*, int);
199 void wclunk(Window*);
200 void wclosewin(Window*);
201 void wcurrent(Window*);
203 void wdelete(Window*, uint, uint);
204 void wdoubleclick(Window*, uint*, uint*);
206 void wframescroll(Window*, int);
207 void wkeyctl(Window*, Rune);
208 void wmousectl(Window*);
209 void wmovemouse(Window*, Point);
210 void wpaste(Window*);
211 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 */
349 Channel* winclosechan;
356 int errorshouldabort;
357 int menuing; /* menu action is pending; waiting for window to be indicated */
358 int snarfversion; /* updated each time it is written */
359 int messagesize; /* negotiated in 9P version setup */