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