8 typedef struct Consreadmesg Consreadmesg;
9 typedef struct Conswritemesg Conswritemesg;
10 typedef struct Stringpair Stringpair;
11 typedef struct Dirtab Dirtab;
12 typedef struct Mouseinfo Mouseinfo;
13 typedef struct Mousereadmesg Mousereadmesg;
14 typedef struct Mousestate Mousestate;
15 typedef struct Timer Timer;
16 typedef struct Wctlmesg Wctlmesg;
17 typedef struct Window Window;
21 Selborder = 0, /* border of selected window */
22 Unselborder = 0, /* border of unselected window */
23 Scrollwid = 12, /* width of scroll bar */
24 Scrollgap = 4, /* gap right of scroll bar */
25 BIG = 3, /* factor by which window dimension can exceed screen */
32 Kscrolloneup = KF|0x20,
33 Kscrollonedown = KF|0x21
36 enum /* control messages */
60 Channel *cw; /* chan(Stringpair) */
65 Channel *c1; /* chan(tuple(char*, int) == Stringpair) */
66 Channel *c2; /* chan(tuple(char*, int) == Stringpair) */
71 Channel *cm; /* chan(Mouse) */
74 struct Stringpair /* rune and nrune or byte and nbyte */
83 ulong counter; /* serial no. of mouse event */
89 int ri; /* read index into queue */
90 int wi; /* write index */
91 ulong counter; /* serial no. of last mouse event we received */
92 ulong lastcounter; /* serial no. of last mouse event sent to client */
93 int lastb; /* last button state we received */
94 uchar qfull; /* filled the queue; no more recording until client comes back */
105 Channel *ck; /* chan(Rune[10]) */
106 Channel *cctl; /* chan(Wctlmesg)[20] */
107 Channel *conswrite; /* chan(Conswritemesg) */
108 Channel *consread; /* chan(Consreadmesg) */
109 Channel *mouseread; /* chan(Mousereadmesg) */
110 Channel *wctlread; /* chan(Consreadmesg) */
111 uint nr; /* number of runes in window */
112 uint maxr; /* number of runes allocated in r */
120 uint iq1; /* last input position */
126 * Rio once used originwindow, so screenr could be different from i->r.
127 * Now they're always the same but the code doesn't assume so.
129 Rectangle screenr; /* screen coordinates of window */
149 int winborder(Window*, Point);
151 void winshell(void*);
152 Window* wlookid(int);
153 Window* wmk(Image*, Mousectl*, Channel*, Channel*, int);
154 Window* wpointto(Point);
156 void wtopme(Window*);
157 void wbottomme(Window*);
158 char* wcontents(Window*, int*);
159 int wbswidth(Window*, Rune);
160 int wclickmatch(Window*, int, int, int, uint*);
162 int wctlmesg(Window*, int, Rectangle, Image*);
163 int wctlmesg(Window*, int, Rectangle, Image*);
164 uint wbacknl(Window*, uint, uint);
165 uint winsert(Window*, Rune*, int, uint);
166 void waddraw(Window*, Rune*, int);
167 void wborder(Window*, int);
168 void wclosewin(Window*);
169 void wcurrent(Window*);
171 void wdelete(Window*, uint, uint);
172 void wdoubleclick(Window*, uint*, uint*);
174 void wframescroll(Window*, int);
175 void wkeyctl(Window*, Rune);
176 void wmousectl(Window*);
177 void wmovemouse(Window*, Point);
178 void wpaste(Window*);
179 void wplumb(Window*);
181 void wrefresh(Window*, Rectangle);
182 void wrepaint(Window*);
183 void wresize(Window*, Image*, int);
184 void wscrdraw(Window*);
185 void wscroll(Window*, int);
186 void wselect(Window*);
187 void wsendctlmesg(Window*, int, Rectangle, Image*);
188 void wsetcursor(Window*, int);
189 void wsetname(Window*);
190 void wsetorigin(Window*, uint, int);
191 void wsetpid(Window*, int, int);
192 void wsetselect(Window*, uint, uint);
193 void wshow(Window*, uint);
194 void wsnarf(Window*);
195 void wscrsleep(Window*, uint);
196 void wsetcols(Window*);
198 void deletetimeoutproc(void*);
204 Channel *c; /* chan(int) */
209 #define Extern extern
213 Extern Mousectl *mousectl;
215 Extern Keyboardctl *keyboardctl;
216 Extern Display *display;
218 Extern Screen *wscreen;
219 Extern Cursor boxcursor;
220 Extern Cursor crosscursor;
221 Extern Cursor sightcursor;
222 Extern Cursor whitearrow;
224 Extern Cursor *corners[9];
225 Extern Image *background;
226 Extern Image *lightgrey;
228 Extern Window **window;
229 Extern Window *wkeyboard; /* window of simulated keyboard */
232 Extern Window *input;
233 Extern QLock all; /* BUG */
234 Extern Window *hidden[100];
238 Extern int scrolling;
240 Extern Channel* winclosechan;
241 Extern Channel* deletechan;
242 Extern char *startdir;
245 Extern int errorshouldabort;
246 Extern int menuing; /* menu action is pending; waiting for window to be indicated */
247 Extern int snarfversion; /* updated each time it is written */
248 Extern int messagesize; /* negotiated in 9P version setup */