]> git.lizzy.rs Git - plan9front.git/blob - sys/man/4/rio
hget: add the -v option to produce progress on stderr, like old hget
[plan9front.git] / sys / man / 4 / rio
1 .TH RIO 4
2 .SH NAME
3 rio \- window system files
4 .SH SYNOPSIS
5 .B rio
6 [
7 .B -i
8 .BI ' cmd '
9 ]
10 [
11 .B -k
12 .BI ' kbdcmd '
13 ]
14 [
15 .B -s
16 ]
17 [
18 .B -b
19 ]
20 [
21 .B -f
22 .I font
23 ]
24 .SH DESCRIPTION
25 The window system
26 .I rio
27 serves a variety of files for reading, writing, and controlling
28 windows.
29 Some of them are virtual versions of system files for dealing
30 with the display, keyboard, and mouse; others control operations
31 of the window system itself.
32 .I Rio
33 posts its service in the
34 .B /srv
35 directory, using a
36 name constructed from a catenation of the user ID
37 and a process id; the environment variable
38 .BR $wsys
39 is set to this service name within processes running under the control
40 of each invocation of
41 .IR rio .
42 Similarly,
43 .I rio
44 posts a named pipe to access the window creation features
45 (see
46 .B window
47 in
48 .IR rio (1))
49 from outside
50 its name space; this is named in
51 .BR $wctl .
52 .PP
53 A
54 .I mount
55 (see
56 .IR bind (1))
57 of
58 .B $wsys
59 causes
60 .I rio
61 to create a new window; the attach specifier in the
62 .I mount
63 gives the coordinates of the created window.
64 The syntax of the specifier is the same as the arguments to
65 .B window
66 (see
67 .IR rio (1)).
68 By default, the window is sized and placed automatically.
69 It is always necessary, however, to provide the process id of the
70 process to whom to deliver notes generated by DEL characters and hangups
71 in that window.
72 That pid is specified by including the string
73 .B -pid
74 .I pid
75 in the attach specifier.  (See the Examples section
76 .IR q.v. )
77 .PP
78 When a window is created either by
79 the
80 .I window
81 command
82 (see
83 .IR rio (1))
84 or by using the menu supplied by
85 .IR rio ,
86 this server is mounted on
87 .BR /mnt/wsys
88 and also
89 .BR /dev ;
90 the files mentioned here
91 appear in both those directories.
92 .PP
93 Some of these files supply virtual versions of services available from the underlying
94 environment, in particular the character terminal files
95 .B cons
96 and
97 .B kbd
98 (see
99 .IR kbdfs (8)),
100 and the mouse files
101 .IR mouse (3)
102 and
103 .IR cursor ,
104 each specific to the window.
105 Note that the
106 .IR draw (3)
107 device multiplexes itself;
108 .IR rio
109 places windows but does not mediate programs' access to the display device.
110 .PP
111 Other files are unique to
112 .IR rio .
113 .TF window
114 .TP
115 .B cons
116 a virtual version of the standard terminal file from
117 .IR kbdfs (8).
118 .I Rio
119 supplies extra editing features and a scroll bar
120 (see
121 .IR rio (1)).
122 .TP
123 .B consctl
124 controls interpretation of console input.
125 Writing strings to it sets these modes:
126 .B rawon
127 turns on raw mode;
128 .B rawoff
129 turns off raw mode;
130 .B holdon
131 turns on hold mode;
132 .B holdoff
133 turns off hold mode.
134 Closing the file makes the window revert to default state
135 (raw off, hold off).
136 .TP
137 .B kbd
138 represents the raw keyboard events (see
139 .IR kbdfs (8))
140 for the corresponding window. While open,
141 navigation keys and input on the
142 .IR cons
143 file is disabled.
144 .TP
145 .B cursor
146 Like
147 .B mouse
148 .RI ( q.v. ),
149 a multiplexed version of the underlying device file, in this case representing the
150 appearance of the mouse cursor when the mouse is within the corresponding window.
151 .TP
152 .B label
153 initially contains a string with the process ID of the lead process
154 in the window and the command being executed there.
155 It may be written and is used as a tag when the window is hidden.
156 .TP
157 .B mouse
158 is a virtual version of the standard mouse file (see
159 .IR mouse (3)).
160 Opening it turns off scrolling, editing, and
161 .IR rio -supplied
162 menus in the associated
163 window.
164 In a standard mouse message, the first character is
165 .BR m ,
166 but
167 .I rio
168 will send an otherwise normal message with the first character
169 .B r
170 if the corresponding window has been resized.
171 The application must then call
172 .B getwindow
173 (see
174 .IR graphics (2))
175 to re-establish its state in the newly moved or changed window.
176 Reading the
177 .B mouse
178 file blocks until the mouse moves or a button changes.
179 Mouse movements or button changes are invisible when the mouse cursor
180 is located outside the window, except that if the mouse leaves the window
181 while a button is pressed, it will continue receiving mouse data until the button is released.
182 .TP
183 .B screen
184 is a read-only file reporting the depth, coordinates, and raster image corresponding to the entire
185 underlying display,
186 in the uncompressed format defined in
187 .IR image (6).
188 .TP
189 .B snarf
190 returns the string currently in the snarf buffer.
191 Writing this file sets the contents of the snarf buffer.
192 When
193 .I rio
194 is run recursively, the inner instance uses the snarf buffer of the parent, rather than
195 managing its own.
196 .TP
197 .B text
198 returns the full contents of the window.
199 It may not be written.
200 .TP
201 .B wctl
202 may be read or written.
203 When read, it returns the location of the window as four decimal integers formatted
204 in the usual 12-character style: upper left
205 .I x
206 and
207 .IR y ,
208 lower right
209 .I x
210 and
211 .IR y .
212 Following these numbers are strings describing the window's state:
213 .B hidden
214 or
215 .BR visible ;
216 .B current
217 or
218 .BR notcurrent .
219 A subsequent read will block until the window changes size, location, or state.
220 When written to,
221 .B wctl
222 accepts messages to change the size or placement of the associated window,
223 and to create new windows.
224 The messages are in a command-line like format, with a command name,
225 possibly followed by options introduced by a minus sign.
226 The options must be separated by blanks, for example
227 .B -dx 100
228 rather than
229 .BR -dx100 .
230 .IP
231 The commands are
232 .B resize
233 (change the size and position of the window),
234 .B move
235 (move the window),
236 .B scroll
237 (enable scrolling in the window),
238 .B noscroll
239 (disable scrolling),
240 .B set
241 (change selected properties of the window),
242 .B top
243 (move the window to the `top', making it fully visible),
244 .B bottom
245 (move the window to the `bottom', perhaps partially or totally obscuring it),
246 .B hide
247 (hide the window),
248 .B unhide
249 (restore a hidden window),
250 .B current
251 (make the window the recipient of keyboard and mouse input),
252 and
253 .B new
254 (make a new window).
255 The
256 .B top
257 and
258 .B bottom
259 commands do not change whether the window is current or not;
260 the others always make the affected window current.
261 .IP
262 Neither
263 .B top
264 nor
265 .B bottom
266 has any options.
267 The
268 .BR resize ,
269 .BR move ,
270 and
271 .B new
272 commands accept
273 .B -minx
274 .IR n ,
275 .B -miny
276 .IR n ,
277 .B -maxx
278 .IR n ,
279 and
280 .BR -maxy
281 .I n
282 options to set the position of the corresponding edge of the window.
283 They also accept an option
284 .B -r
285 .I minx miny maxx maxy
286 to set all four at once.
287 The
288 .B resize
289 and
290 .B new
291 commands accept
292 .B -dx
293 .I n
294 and
295 .B -dy
296 .I n
297 to set the width and height of the window.
298 By default,
299 .I rio
300 will choose a convenient geometry automatically.
301 .IP
302 Finally, the
303 .B new
304 command accepts an optional shell command and argument string,
305 given as plain strings after any standard options, to run in the window
306 instead of the default
307 .B rc
308 .B -i
309 (see
310 .IR rc (1)).
311 The
312 .B -pid
313 .I pid
314 option to
315 .B new
316 identifies the
317 .I pid
318 of the process whose `note group' should receive interrupt
319 and hangup notes generated in the window.
320 The initial working directory of the new window may be set by a
321 .B -cd
322 .I directory
323 option.
324 The
325 .B -hide
326 option causes the window to be created off-screen, in the hidden state, while
327 .B -scroll
328 and
329 .B -noscroll
330 set the initial scrolling state of the window; the default is that of the main program.
331 .IP
332 The
333 .B set
334 command accepts a set of parameters in the same style; only
335 .B -pid
336 .I pid
337 is implemented.
338 .IP
339 So programs outside name spaces controlled by
340 .I rio
341 may create windows,
342 .B wctl
343 .B new
344 messages may also be written to the named pipe identified by
345 .BR $wctl .
346 .TP
347 .B wdir
348 is a read/write text file containing
349 .IR rio 's
350 idea of the current working directory of the process running in the window.
351 It is used to fill in the
352 .B wdir
353 field of
354 .IR plumb (6)
355 messages
356 .I rio
357 generates from the
358 .B plumb
359 menu item on button 2.
360 The file is writable so the program may update it;
361 .I rio
362 is otherwise unaware of
363 .IR chdir (2)
364 calls its clients make.
365 In particular,
366 .IR rc (1)
367 maintains
368 .B /dev/wdir
369 in default
370 .IR rio (1)
371 windows.
372 .TP
373 .B winid
374 returns the unique and unchangeable ID for the window;
375 it is a string of digits.
376 .TP
377 .B window
378 is the virtual version of
379 .BR /dev/screen .
380 It contains the depth, coordinates, and
381 uncompressed raster image corresponding to the associated
382 window.
383 .TP
384 .B wsys
385 is a directory containing a subdirectory for each window, named
386 by the unique ID for that window.  Within each subdirectory
387 are entries corresponding to several of the special files associated
388 with that window:
389 .BR cons ,
390 .BR consctl ,
391 .BR label ,
392 .BR mouse ,
393 etc.
394 .SH EXAMPLES
395 Cause a window to be created in the upper left corner,
396 and the word
397 .L hi
398 to be printed there.
399 .IP
400 .EX
401 mount $wsys /tmp 'new -r 0 0 128 64 -pid '$pid
402 echo hi > /tmp/cons
403 .EE
404 .PP
405 Start
406 .IR sam (1)
407 in a large horizontal window.
408 .IP
409 .EX
410 echo new -dx 800 -dy 200 -cd /sys/src/cmd sam > /dev/wctl
411 .EE
412 .PP
413 Print the screen image of window with id 123.
414 .IP
415 .EX
416 lp /dev/wsys/123/window
417 .EE
418 .SH SOURCE
419 .B /sys/src/cmd/rio
420 .SH SEE ALSO
421 .IR rio (1),
422 .IR draw (3),
423 .IR mouse (3),
424 .IR kbdfs (8),
425 .IR event (2),
426 .IR graphics (2).