70
|
1 /* Generic device functions.
|
0
|
2 Copyright (C) 1994, 1995 Board of Trustees, University of Illinois.
|
|
3 Copyright (C) 1994, 1995 Free Software Foundation, Inc.
|
|
4 Copyright (C) 1995, 1996 Ben Wing
|
|
5
|
|
6 This file is part of XEmacs.
|
|
7
|
|
8 XEmacs is free software; you can redistribute it and/or modify it
|
|
9 under the terms of the GNU General Public License as published by the
|
|
10 Free Software Foundation; either version 2, or (at your option) any
|
|
11 later version.
|
|
12
|
|
13 XEmacs is distributed in the hope that it will be useful, but WITHOUT
|
|
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
16 for more details.
|
|
17
|
|
18 You should have received a copy of the GNU General Public License
|
|
19 along with XEmacs; see the file COPYING. If not, write to
|
|
20 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
21 Boston, MA 02111-1307, USA. */
|
|
22
|
|
23 /* Synched up with: Not in FSF. */
|
|
24
|
|
25 /* Original version by Chuck Thompson;
|
|
26 rewritten and expanded by Ben Wing. */
|
|
27
|
|
28 #include <config.h>
|
|
29 #include "lisp.h"
|
|
30
|
|
31 #include "buffer.h"
|
|
32 #include "console.h"
|
|
33 #include "device.h"
|
|
34 #include "elhash.h"
|
|
35 #include "events.h"
|
|
36 #include "faces.h"
|
|
37 #include "frame.h"
|
|
38 #include "keymap.h"
|
|
39 #include "redisplay.h"
|
|
40 #include "scrollbar.h"
|
|
41 #include "specifier.h"
|
|
42 #include "sysdep.h"
|
|
43 #include "window.h"
|
|
44
|
|
45 #include "syssignal.h"
|
|
46
|
|
47 /* Vdefault_device is the firstly-created non-stream device that's still
|
|
48 around. We don't really use it anywhere currently, but it might
|
|
49 be used for resourcing at some point. (Currently we use
|
|
50 Vdefault_x_device.) */
|
|
51 Lisp_Object Vdefault_device;
|
|
52
|
|
53 Lisp_Object Vcreate_device_hook, Vdelete_device_hook;
|
|
54
|
|
55 /* Device classes */
|
|
56 /* Qcolor defined in general.c */
|
|
57 Lisp_Object Qgrayscale, Qmono;
|
|
58
|
|
59 Lisp_Object Qdevicep, Qdevice_live_p;
|
|
60 Lisp_Object Qdelete_device;
|
|
61 Lisp_Object Qcreate_device_hook;
|
|
62 Lisp_Object Qdelete_device_hook;
|
|
63
|
|
64 Lisp_Object Vdevice_class_list;
|
|
65
|
|
66 MAC_DEFINE (struct device *, MTdevice_data)
|
|
67
|
|
68
|
|
69 static Lisp_Object mark_device (Lisp_Object, void (*) (Lisp_Object));
|
|
70 static void print_device (Lisp_Object, Lisp_Object, int);
|
|
71 DEFINE_LRECORD_IMPLEMENTATION ("device", device,
|
|
72 mark_device, print_device, 0, 0, 0,
|
|
73 struct device);
|
|
74
|
|
75 static Lisp_Object
|
|
76 mark_device (Lisp_Object obj, void (*markobj) (Lisp_Object))
|
|
77 {
|
|
78 struct device *d = XDEVICE (obj);
|
|
79
|
|
80 ((markobj) (d->name));
|
|
81 ((markobj) (d->connection));
|
|
82 ((markobj) (d->canon_connection));
|
|
83 ((markobj) (d->console));
|
|
84 ((markobj) (d->_selected_frame));
|
|
85 ((markobj) (d->frame_with_focus_real));
|
|
86 ((markobj) (d->frame_with_focus_for_hooks));
|
|
87 ((markobj) (d->frame_that_ought_to_have_focus));
|
|
88 ((markobj) (d->device_class));
|
|
89 ((markobj) (d->user_defined_tags));
|
|
90 ((markobj) (d->pixel_to_glyph_cache.obj1));
|
|
91 ((markobj) (d->pixel_to_glyph_cache.obj2));
|
|
92
|
|
93 ((markobj) (d->color_instance_cache));
|
|
94 ((markobj) (d->font_instance_cache));
|
70
|
95 #ifdef MULE
|
|
96 ((markobj) (d->charset_font_cache));
|
|
97 #endif
|
0
|
98 ((markobj) (d->image_instance_cache));
|
|
99
|
|
100 if (d->devmeths)
|
|
101 {
|
|
102 ((markobj) (d->devmeths->symbol));
|
|
103 MAYBE_DEVMETH (d, mark_device, (d, markobj));
|
|
104 }
|
|
105
|
|
106 return (d->frame_list);
|
|
107 }
|
|
108
|
|
109 static void
|
|
110 print_device (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag)
|
|
111 {
|
|
112 struct device *d = XDEVICE (obj);
|
|
113 char buf[256];
|
|
114
|
|
115 if (print_readably)
|
|
116 error ("printing unreadable object #<device %s 0x%x>",
|
14
|
117 XSTRING_DATA (d->name), d->header.uid);
|
0
|
118
|
|
119 sprintf (buf, "#<%s-device", !DEVICE_LIVE_P (d) ? "dead" :
|
|
120 DEVICE_TYPE_NAME (d));
|
|
121 write_c_string (buf, printcharfun);
|
|
122 if (DEVICE_LIVE_P (d))
|
|
123 {
|
|
124 write_c_string (" on ", printcharfun);
|
|
125 print_internal (DEVICE_CONNECTION (d), printcharfun, 1);
|
|
126 }
|
|
127 sprintf (buf, " 0x%x>", d->header.uid);
|
|
128 write_c_string (buf, printcharfun);
|
|
129 }
|
|
130
|
|
131
|
|
132 int
|
|
133 valid_device_class_p (Lisp_Object class)
|
|
134 {
|
|
135 return !NILP (memq_no_quit (class, Vdevice_class_list));
|
|
136 }
|
|
137
|
20
|
138 DEFUN ("valid-device-class-p", Fvalid_device_class_p, 1, 1, 0, /*
|
0
|
139 Given a DEVICE-CLASS, return t if it is valid.
|
|
140 Valid classes are 'color, 'grayscale, and 'mono.
|
20
|
141 */
|
|
142 (device_class))
|
0
|
143 {
|
185
|
144 return valid_device_class_p (device_class) ? Qt : Qnil;
|
0
|
145 }
|
|
146
|
20
|
147 DEFUN ("device-class-list", Fdevice_class_list, 0, 0, 0, /*
|
0
|
148 Return a list of valid device classes.
|
20
|
149 */
|
|
150 ())
|
0
|
151 {
|
|
152 return Fcopy_sequence (Vdevice_class_list);
|
|
153 }
|
|
154
|
|
155 static struct device *
|
|
156 allocate_device (Lisp_Object console)
|
|
157 {
|
185
|
158 Lisp_Object device;
|
|
159 struct device *d = alloc_lcrecord_type (struct device, lrecord_device);
|
0
|
160 struct gcpro gcpro1;
|
|
161
|
|
162 zero_lcrecord (d);
|
|
163
|
|
164 XSETDEVICE (device, d);
|
|
165 GCPRO1 (device);
|
|
166
|
|
167 d->name = Qnil;
|
|
168 d->console = console;
|
|
169 d->connection = Qnil;
|
|
170 d->canon_connection = Qnil;
|
|
171 d->frame_list = Qnil;
|
|
172 d->_selected_frame = Qnil;
|
|
173 d->frame_with_focus_real = Qnil;
|
|
174 d->frame_with_focus_for_hooks = Qnil;
|
|
175 d->frame_that_ought_to_have_focus = Qnil;
|
|
176 d->device_class = Qnil;
|
|
177 d->user_defined_tags = Qnil;
|
|
178 d->pixel_to_glyph_cache.obj1 = Qnil;
|
|
179 d->pixel_to_glyph_cache.obj2 = Qnil;
|
|
180
|
|
181 d->infd = d->outfd = -1;
|
|
182
|
|
183 /* #### is 20 reasonable? */
|
|
184 d->color_instance_cache = make_lisp_hashtable (20, HASHTABLE_KEY_WEAK,
|
|
185 HASHTABLE_EQUAL);
|
|
186 d->font_instance_cache = make_lisp_hashtable (20, HASHTABLE_KEY_WEAK,
|
|
187 HASHTABLE_EQUAL);
|
70
|
188 #ifdef MULE
|
|
189 /* Note that the following table is bi-level. */
|
|
190 d->charset_font_cache = make_lisp_hashtable (20, HASHTABLE_NONWEAK,
|
|
191 HASHTABLE_EQ);
|
|
192 #endif
|
0
|
193 /*
|
|
194 Note that the image instance cache is actually bi-level.
|
|
195 See device.h. We use a low number here because most of the
|
|
196 time there aren't very many diferent masks that will be used.
|
|
197 */
|
|
198 d->image_instance_cache = make_lisp_hashtable (5, HASHTABLE_NONWEAK,
|
|
199 HASHTABLE_EQ);
|
|
200
|
|
201 UNGCPRO;
|
|
202 return d;
|
|
203 }
|
|
204
|
|
205 struct device *
|
|
206 decode_device (Lisp_Object device)
|
|
207 {
|
|
208 if (NILP (device))
|
|
209 device = Fselected_device (Qnil);
|
|
210 /* quietly accept frames for the device arg */
|
|
211 if (FRAMEP (device))
|
|
212 device = FRAME_DEVICE (decode_frame (device));
|
|
213 CHECK_LIVE_DEVICE (device);
|
|
214 return XDEVICE (device);
|
|
215 }
|
|
216
|
|
217 Lisp_Object
|
|
218 make_device (struct device *d)
|
|
219 {
|
|
220 Lisp_Object device = Qnil;
|
|
221 XSETDEVICE (device, d);
|
|
222 return device;
|
|
223 }
|
|
224
|
20
|
225 DEFUN ("dfw-device", Fdfw_device, 1, 1, 0, /*
|
0
|
226 Given a device, frame, or window, return the associated device.
|
|
227 Return nil otherwise.
|
20
|
228 */
|
|
229 (obj))
|
0
|
230 {
|
|
231 return DFW_DEVICE (obj);
|
|
232 }
|
|
233
|
|
234
|
20
|
235 DEFUN ("selected-device", Fselected_device, 0, 1, 0, /*
|
0
|
236 Return the device which is currently active.
|
|
237 If optional CONSOLE is non-nil, return the device that would be currently
|
|
238 active if CONSOLE were the selected console.
|
20
|
239 */
|
|
240 (console))
|
0
|
241 {
|
|
242 if (NILP (console) && NILP (Vselected_console))
|
|
243 return Qnil; /* happens early in temacs */
|
|
244 return CONSOLE_SELECTED_DEVICE (decode_console (console));
|
|
245 }
|
|
246
|
|
247 /* Called from selected_frame_1(), called from Fselect_window() */
|
|
248 void
|
|
249 select_device_1 (Lisp_Object device)
|
|
250 {
|
|
251 struct device *dev = XDEVICE (device);
|
|
252 Lisp_Object old_selected_device = Fselected_device (Qnil);
|
185
|
253
|
0
|
254 if (EQ (device, old_selected_device))
|
|
255 return;
|
|
256
|
|
257 /* now select the device's console */
|
|
258 CONSOLE_SELECTED_DEVICE (XCONSOLE (DEVICE_CONSOLE (dev))) = device;
|
|
259 select_console_1 (DEVICE_CONSOLE (dev));
|
|
260 }
|
|
261
|
20
|
262 DEFUN ("select-device", Fselect_device, 1, 1, 0, /*
|
0
|
263 Select the device DEVICE.
|
|
264 Subsequent editing commands apply to its console, selected frame,
|
|
265 and selected window.
|
|
266 The selection of DEVICE lasts until the next time the user does
|
|
267 something to select a different device, or until the next time this
|
|
268 function is called.
|
20
|
269 */
|
|
270 (device))
|
0
|
271 {
|
|
272 CHECK_LIVE_DEVICE (device);
|
|
273
|
|
274 /* select the device's selected frame's selected window. This will call
|
|
275 selected_frame_1()->selected_device_1()->selected_console_1(). */
|
|
276 if (!NILP (DEVICE_SELECTED_FRAME (XDEVICE (device))))
|
|
277 Fselect_window (FRAME_SELECTED_WINDOW
|
|
278 (XFRAME (DEVICE_SELECTED_FRAME (XDEVICE (device)))));
|
|
279 else
|
|
280 error ("Can't select a device with no frames");
|
|
281 return Qnil;
|
|
282 }
|
|
283
|
|
284 void
|
|
285 set_device_selected_frame (struct device *d, Lisp_Object frame)
|
|
286 {
|
|
287 if (!NILP (frame) && !FRAME_MINIBUF_ONLY_P (XFRAME (frame)))
|
|
288 set_console_last_nonminibuf_frame (XCONSOLE (DEVICE_CONSOLE (d)), frame);
|
|
289 d->_selected_frame = frame;
|
|
290 }
|
|
291
|
20
|
292 DEFUN ("set-device-selected-frame", Fset_device_selected_frame, 2, 2, 0, /*
|
0
|
293 Set the selected frame of device object DEVICE to FRAME.
|
|
294 If DEVICE is nil, the selected device is used.
|
|
295 If DEVICE is the selected device, this makes FRAME the selected frame.
|
20
|
296 */
|
|
297 (device, frame))
|
0
|
298 {
|
185
|
299 struct device *d = decode_device (device);
|
|
300
|
|
301 XSETDEVICE (device, d);
|
0
|
302 CHECK_LIVE_FRAME (frame);
|
|
303
|
|
304 if (! EQ (device, FRAME_DEVICE (XFRAME (frame))))
|
|
305 error ("In `set-device-selected-frame', FRAME is not on DEVICE");
|
|
306
|
|
307 if (EQ (device, Fselected_device (Qnil)))
|
|
308 return Fselect_frame (frame);
|
|
309
|
|
310 set_device_selected_frame (XDEVICE (device), frame);
|
|
311 return frame;
|
|
312 }
|
|
313
|
20
|
314 DEFUN ("devicep", Fdevicep, 1, 1, 0, /*
|
0
|
315 Return non-nil if OBJECT is a device.
|
20
|
316 */
|
|
317 (object))
|
0
|
318 {
|
185
|
319 return DEVICEP (object) ? Qt : Qnil;
|
0
|
320 }
|
|
321
|
20
|
322 DEFUN ("device-live-p", Fdevice_live_p, 1, 1, 0, /*
|
0
|
323 Return non-nil if OBJECT is a device that has not been deleted.
|
20
|
324 */
|
|
325 (object))
|
0
|
326 {
|
185
|
327 return DEVICEP (object) && DEVICE_LIVE_P (XDEVICE (object)) ? Qt : Qnil;
|
0
|
328 }
|
|
329
|
20
|
330 DEFUN ("device-name", Fdevice_name, 0, 1, 0, /*
|
0
|
331 Return the name of the specified device.
|
|
332 DEVICE defaults to the selected device if omitted.
|
20
|
333 */
|
|
334 (device))
|
0
|
335 {
|
|
336 return DEVICE_NAME (decode_device (device));
|
|
337 }
|
|
338
|
20
|
339 DEFUN ("device-connection", Fdevice_connection, 0, 1, 0, /*
|
0
|
340 Return the connection of the specified device.
|
|
341 DEVICE defaults to the selected device if omitted.
|
20
|
342 */
|
|
343 (device))
|
0
|
344 {
|
|
345 return DEVICE_CONNECTION (decode_device (device));
|
|
346 }
|
|
347
|
20
|
348 DEFUN ("device-console", Fdevice_console, 0, 1, 0, /*
|
0
|
349 Return the console of the specified device.
|
|
350 DEVICE defaults to the selected device if omitted.
|
20
|
351 */
|
|
352 (device))
|
0
|
353 {
|
|
354 return DEVICE_CONSOLE (decode_device (device));
|
|
355 }
|
|
356
|
|
357 #ifdef HAVE_X_WINDOWS
|
|
358 extern Lisp_Object Vdefault_x_device;
|
|
359 #endif
|
|
360
|
|
361 #ifdef HAVE_X_WINDOWS
|
|
362
|
|
363 static void
|
|
364 init_global_resources (struct device *d)
|
|
365 {
|
|
366 init_global_faces (d);
|
|
367 #ifdef HAVE_SCROLLBARS
|
|
368 init_global_scrollbars (d);
|
|
369 #endif
|
|
370 #ifdef HAVE_TOOLBARS
|
|
371 init_global_toolbars (d);
|
|
372 #endif
|
|
373 }
|
|
374
|
|
375 #endif
|
|
376
|
|
377 static void
|
|
378 init_device_resources (struct device *d)
|
|
379 {
|
|
380 init_device_faces (d);
|
|
381 #ifdef HAVE_SCROLLBARS
|
|
382 init_device_scrollbars (d);
|
|
383 #endif
|
|
384 #ifdef HAVE_TOOLBARS
|
|
385 init_device_toolbars (d);
|
|
386 #endif
|
|
387 }
|
|
388
|
|
389 static Lisp_Object
|
|
390 semi_canonicalize_device_connection (struct console_methods *meths,
|
|
391 Lisp_Object name, Error_behavior errb)
|
|
392 {
|
|
393 return CONTYPE_METH_OR_GIVEN (meths, semi_canonicalize_device_connection,
|
|
394 (name, errb), name);
|
|
395 }
|
|
396
|
|
397 static Lisp_Object
|
|
398 canonicalize_device_connection (struct console_methods *meths,
|
|
399 Lisp_Object name, Error_behavior errb)
|
|
400 {
|
|
401 return CONTYPE_METH_OR_GIVEN (meths, canonicalize_device_connection,
|
|
402 (name, errb), name);
|
|
403 }
|
|
404
|
|
405 static Lisp_Object
|
|
406 find_device_of_type (struct console_methods *meths, Lisp_Object canon)
|
|
407 {
|
|
408 Lisp_Object devcons, concons;
|
|
409
|
|
410 DEVICE_LOOP_NO_BREAK (devcons, concons)
|
|
411 {
|
|
412 Lisp_Object device = XCAR (devcons);
|
|
413
|
|
414 if (EQ (CONMETH_TYPE (meths), DEVICE_TYPE (XDEVICE (device)))
|
195
|
415 && internal_equal (DEVICE_CANON_CONNECTION (XDEVICE (device)),
|
|
416 canon, 0))
|
0
|
417 return device;
|
|
418 }
|
|
419
|
|
420 return Qnil;
|
|
421 }
|
|
422
|
20
|
423 DEFUN ("find-device", Ffind_device, 1, 2, 0, /*
|
0
|
424 Look for an existing device attached to connection CONNECTION.
|
|
425 Return the device if found; otherwise, return nil.
|
|
426
|
|
427 If TYPE is specified, only return devices of that type; otherwise,
|
|
428 return devices of any type. (It is possible, although unlikely,
|
|
429 that two devices of different types could have the same connection
|
|
430 name; in such a case, the first device found is returned.)
|
20
|
431 */
|
|
432 (connection, type))
|
0
|
433 {
|
|
434 Lisp_Object canon = Qnil;
|
|
435 struct gcpro gcpro1;
|
|
436
|
|
437 GCPRO1 (canon);
|
|
438
|
|
439 if (!NILP (type))
|
|
440 {
|
|
441 struct console_methods *conmeths = decode_console_type (type, ERROR_ME);
|
|
442 canon = canonicalize_device_connection (conmeths, connection,
|
|
443 ERROR_ME_NOT);
|
|
444 if (UNBOUNDP (canon))
|
|
445 RETURN_UNGCPRO (Qnil);
|
|
446
|
|
447 RETURN_UNGCPRO (find_device_of_type (conmeths, canon));
|
|
448 }
|
|
449 else
|
|
450 {
|
|
451 int i;
|
|
452
|
|
453 for (i = 0; i < Dynarr_length (the_console_type_entry_dynarr); i++)
|
|
454 {
|
|
455 struct console_methods *conmeths =
|
|
456 Dynarr_at (the_console_type_entry_dynarr, i).meths;
|
|
457 canon = canonicalize_device_connection (conmeths, connection,
|
|
458 ERROR_ME_NOT);
|
|
459 if (!UNBOUNDP (canon))
|
|
460 {
|
|
461 Lisp_Object device = find_device_of_type (conmeths, canon);
|
|
462 if (!NILP (device))
|
|
463 RETURN_UNGCPRO (device);
|
|
464 }
|
|
465 }
|
|
466
|
|
467 RETURN_UNGCPRO (Qnil);
|
|
468 }
|
|
469 }
|
|
470
|
20
|
471 DEFUN ("get-device", Fget_device, 1, 2, 0, /*
|
0
|
472 Look for an existing device attached to connection CONNECTION.
|
|
473 Return the device if found; otherwise, signal an error.
|
|
474
|
|
475 If TYPE is specified, only return devices of that type; otherwise,
|
|
476 return devices of any type. (It is possible, although unlikely,
|
|
477 that two devices of different types could have the same connection
|
|
478 name; in such a case, the first device found is returned.)
|
20
|
479 */
|
|
480 (connection, type))
|
0
|
481 {
|
|
482 Lisp_Object device = Ffind_device (connection, type);
|
|
483 if (NILP (device))
|
|
484 {
|
|
485 if (NILP (type))
|
|
486 signal_simple_error ("No such device", connection);
|
|
487 else
|
|
488 signal_simple_error_2 ("No such device", type, connection);
|
|
489 }
|
|
490 return device;
|
|
491 }
|
|
492
|
155
|
493 static Lisp_Object
|
|
494 delete_deviceless_console(Lisp_Object console)
|
|
495 {
|
|
496 if (NILP (XCONSOLE (console)->device_list))
|
185
|
497 Fdelete_console (console, Qnil);
|
155
|
498 return Qnil;
|
|
499 }
|
|
500
|
20
|
501 DEFUN ("make-device", Fmake_device, 2, 3, 0, /*
|
0
|
502 Create a new device of type TYPE, attached to connection CONNECTION.
|
|
503
|
|
504 The valid values for CONNECTION are device-specific; however,
|
|
505 CONNECTION is generally a string. (Specifically, for X devices,
|
|
506 CONNECTION should be a display specification such as "foo:0", and
|
|
507 for TTY devices, CONNECTION should be the filename of a TTY device
|
|
508 file, such as "/dev/ttyp4", or nil to refer to XEmacs' standard
|
|
509 input/output.)
|
|
510
|
|
511 PROPS, if specified, should be a plist of properties controlling
|
|
512 device creation.
|
|
513
|
|
514 If CONNECTION specifies an already-existing device connection, that
|
|
515 device is simply returned; no new device is created, and PROPS
|
|
516 have no effect.
|
20
|
517 */
|
|
518 (type, connection, props))
|
0
|
519 {
|
|
520 /* This function can GC */
|
|
521 struct device *d;
|
|
522 struct console *con;
|
|
523 Lisp_Object device = Qnil;
|
|
524 Lisp_Object console = Qnil;
|
|
525 Lisp_Object name = Qnil;
|
|
526 struct console_methods *conmeths;
|
155
|
527 int speccount = specpdl_depth();
|
0
|
528
|
|
529 struct gcpro gcpro1, gcpro2, gcpro3;
|
|
530 #ifdef HAVE_X_WINDOWS
|
|
531 /* #### icky-poo. If this is the first X device we are creating,
|
|
532 then retrieve the global face resources. We have to do it
|
|
533 here, at the same time as (or just before) the device face
|
|
534 resources are retrieved; specifically, it needs to be done
|
|
535 after the device has been created but before any frames have
|
|
536 been popped up or much anything else has been done. It's
|
|
537 possible for other devices to specify different global
|
|
538 resources (there's a property on each X server's root window
|
|
539 that holds some resources); tough luck for the moment.
|
|
540
|
|
541 This is a nasty violation of device independence, but
|
|
542 there's not a whole lot I can figure out to do about it.
|
|
543 The real problem is that the concept of resources is not
|
|
544 generalized away from X. Similar resource-related
|
|
545 device-independence violations occur in faces.el. */
|
|
546 int first_x_device = NILP (Vdefault_x_device) && EQ (type, Qx);
|
|
547 #endif
|
|
548
|
|
549 GCPRO3 (device, console, name);
|
|
550
|
|
551 conmeths = decode_console_type (type, ERROR_ME_NOT);
|
|
552 if (!conmeths)
|
|
553 signal_simple_error ("Invalid device type", type);
|
|
554
|
|
555 device = Ffind_device (connection, type);
|
|
556 if (!NILP (device))
|
|
557 RETURN_UNGCPRO (device);
|
|
558
|
|
559 name = Fplist_get (props, Qname, Qnil);
|
|
560
|
|
561 {
|
|
562 Lisp_Object conconnect =
|
|
563 CONTYPE_METH_OR_GIVEN (conmeths,
|
|
564 device_to_console_connection,
|
|
565 (connection, ERROR_ME),
|
|
566 connection);
|
|
567 console = create_console (name, type, conconnect, props);
|
|
568 }
|
|
569
|
155
|
570 record_unwind_protect(delete_deviceless_console, console);
|
|
571
|
0
|
572 con = XCONSOLE (console);
|
|
573 d = allocate_device (console);
|
|
574 XSETDEVICE (device, d);
|
|
575
|
|
576 d->devmeths = con->conmeths;
|
|
577
|
|
578 DEVICE_NAME (d) = name;
|
|
579 DEVICE_CONNECTION (d) = semi_canonicalize_device_connection (conmeths,
|
|
580 connection,
|
|
581 ERROR_ME);
|
|
582 DEVICE_CANON_CONNECTION (d) = canonicalize_device_connection (conmeths,
|
|
583 connection,
|
|
584 ERROR_ME);
|
|
585
|
|
586 MAYBE_DEVMETH (d, init_device, (d, props));
|
|
587
|
|
588 /* Do it this way so that the device list is in order of creation */
|
|
589 con->device_list = nconc2 (con->device_list, Fcons (device, Qnil));
|
|
590 RESET_CHANGED_SET_FLAGS;
|
|
591 if (NILP (Vdefault_device) || DEVICE_STREAM_P (XDEVICE (Vdefault_device)))
|
|
592 Vdefault_device = device;
|
|
593
|
|
594 init_device_sound (d);
|
|
595 #ifdef HAVE_X_WINDOWS
|
|
596 if (first_x_device)
|
|
597 init_global_resources (d);
|
|
598 #endif
|
|
599 init_device_resources (d);
|
|
600
|
|
601 MAYBE_DEVMETH (d, finish_init_device, (d, props));
|
|
602
|
|
603 /* If this is the first device on the console, make it the selected one. */
|
|
604 if (NILP (CONSOLE_SELECTED_DEVICE (con)))
|
|
605 CONSOLE_SELECTED_DEVICE (con) = device;
|
|
606
|
|
607 /* #### the following should trap errors. */
|
|
608 setup_device_initial_specifier_tags (d);
|
|
609
|
|
610 UNGCPRO;
|
155
|
611 unbind_to(speccount, Qnil);
|
0
|
612 return device;
|
|
613 }
|
|
614
|
|
615 /* find a device other than the selected one. Prefer non-stream
|
|
616 devices over stream devices. Maybe stay on the same console. */
|
|
617
|
|
618 static Lisp_Object
|
|
619 find_other_device (Lisp_Object device, int on_same_console)
|
|
620 {
|
|
621 Lisp_Object devcons = Qnil, concons = Qnil;
|
|
622 Lisp_Object console = DEVICE_CONSOLE (XDEVICE (device));
|
|
623
|
|
624 /* look for a non-stream device */
|
|
625 DEVICE_LOOP_NO_BREAK (devcons, concons)
|
|
626 {
|
|
627 Lisp_Object dev = XCAR (devcons);
|
|
628 if (on_same_console && !EQ (console, DEVICE_CONSOLE (XDEVICE (dev))))
|
|
629 continue;
|
|
630 if (!DEVICE_STREAM_P (XDEVICE (dev)) && !EQ (dev, device) &&
|
|
631 !NILP (DEVICE_SELECTED_FRAME (XDEVICE (dev))))
|
|
632 goto double_break_1;
|
|
633 }
|
|
634
|
|
635 double_break_1:
|
|
636 if (!NILP (devcons))
|
|
637 return XCAR (devcons);
|
|
638
|
|
639 /* OK, now look for a stream device */
|
|
640 DEVICE_LOOP_NO_BREAK (devcons, concons)
|
|
641 {
|
|
642 Lisp_Object dev = XCAR (devcons);
|
|
643 if (on_same_console && !EQ (console, DEVICE_CONSOLE (XDEVICE (dev))))
|
|
644 continue;
|
|
645 if (!EQ (dev, device) && !NILP (DEVICE_SELECTED_FRAME (XDEVICE (dev))))
|
|
646 goto double_break_2;
|
|
647 }
|
|
648 double_break_2:
|
|
649 if (!NILP (devcons))
|
|
650 return XCAR (devcons);
|
|
651
|
|
652 /* Sorry, there ain't none */
|
|
653 return Qnil;
|
|
654 }
|
|
655
|
|
656 static int
|
|
657 find_nonminibuffer_frame_not_on_device_predicate (Lisp_Object frame,
|
|
658 void *closure)
|
|
659 {
|
|
660 Lisp_Object device;
|
|
661
|
|
662 VOID_TO_LISP (device, closure);
|
|
663 if (FRAME_MINIBUF_ONLY_P (XFRAME (frame)))
|
|
664 return 0;
|
|
665 if (EQ (device, FRAME_DEVICE (XFRAME (frame))))
|
|
666 return 0;
|
|
667 return 1;
|
|
668 }
|
|
669
|
|
670 Lisp_Object
|
|
671 find_nonminibuffer_frame_not_on_device (Lisp_Object device)
|
|
672 {
|
|
673 return find_some_frame (find_nonminibuffer_frame_not_on_device_predicate,
|
|
674 LISP_TO_VOID (device));
|
|
675 }
|
|
676
|
|
677
|
|
678 /* Delete device D.
|
|
679
|
|
680 If FORCE is non-zero, allow deletion of the only frame.
|
|
681
|
|
682 If CALLED_FROM_DELETE_CONSOLE is non-zero, then, if
|
|
683 deleting the last device on a console, just delete it,
|
|
684 instead of calling `delete-console'.
|
|
685
|
|
686 If FROM_IO_ERROR is non-zero, then the device is gone due
|
|
687 to an I/O error. This affects what happens if we exit
|
|
688 (we do an emergency exit instead of `save-buffers-kill-emacs'.)
|
|
689 */
|
|
690
|
|
691 void
|
|
692 delete_device_internal (struct device *d, int force,
|
|
693 int called_from_delete_console,
|
|
694 int from_io_error)
|
|
695 {
|
|
696 /* This function can GC */
|
|
697 struct console *c;
|
|
698 Lisp_Object device = Qnil;
|
|
699 struct gcpro gcpro1;
|
|
700
|
|
701 /* OK to delete an already-deleted device. */
|
|
702 if (!DEVICE_LIVE_P (d))
|
|
703 return;
|
|
704
|
|
705 XSETDEVICE (device, d);
|
|
706 GCPRO1 (device);
|
|
707
|
|
708 c = XCONSOLE (DEVICE_CONSOLE (d));
|
|
709
|
|
710 if (!called_from_delete_console)
|
|
711 {
|
|
712 int delete_console = 0;
|
|
713 /* If we're deleting the only device on the console,
|
|
714 delete the console. */
|
|
715 if ((XINT (Flength (CONSOLE_DEVICE_LIST (c))) == 1)
|
|
716 /* if we just created the device, it might not be listed,
|
|
717 or something ... */
|
|
718 && !NILP (memq_no_quit (device, CONSOLE_DEVICE_LIST (c))))
|
|
719 delete_console = 1;
|
|
720 /* Or if there aren't any nonminibuffer frames that would be
|
|
721 left, delete the console (this will make XEmacs exit). */
|
|
722 else if (NILP (find_nonminibuffer_frame_not_on_device (device)))
|
|
723 delete_console = 1;
|
|
724
|
|
725 if (delete_console)
|
|
726 {
|
|
727 delete_console_internal (c, force, 0, from_io_error);
|
|
728 UNGCPRO;
|
|
729 return;
|
|
730 }
|
|
731 }
|
|
732
|
|
733 reset_one_device (d);
|
|
734
|
|
735 {
|
|
736 Lisp_Object frmcons;
|
|
737
|
|
738 /* First delete all frames without their own minibuffers,
|
|
739 to avoid errors coming from attempting to delete a frame
|
|
740 that is a surrogate for another frame. */
|
|
741 DEVICE_FRAME_LOOP (frmcons, d)
|
|
742 {
|
|
743 struct frame *f = XFRAME (XCAR (frmcons));
|
|
744 /* delete_frame_internal() might do anything such as run hooks,
|
|
745 so be defensive. */
|
|
746 if (FRAME_LIVE_P (f) && !FRAME_HAS_MINIBUF_P (f))
|
|
747 delete_frame_internal (f, 1, 1, from_io_error);
|
|
748
|
|
749 if (!DEVICE_LIVE_P (d)) /* make sure the delete-*-hook didn't
|
|
750 go ahead and delete anything */
|
|
751 {
|
|
752 UNGCPRO;
|
|
753 return;
|
|
754 }
|
|
755 }
|
|
756
|
|
757 /* #### This should probably be a device method but it is time for
|
|
758 19.14 to go out the door. */
|
|
759 #ifdef HAVE_X_WINDOWS
|
|
760 /* Next delete all frames which have the popup property to avoid
|
|
761 deleting a child after its parent. */
|
|
762 DEVICE_FRAME_LOOP (frmcons, d)
|
|
763 {
|
|
764 struct frame *f = XFRAME (XCAR (frmcons));
|
|
765
|
|
766 if (FRAME_LIVE_P (f))
|
|
767 {
|
|
768 Lisp_Object popup = Fframe_property (XCAR (frmcons), Qpopup, Qnil);
|
|
769 if (!NILP (popup))
|
|
770 delete_frame_internal (f, 1, 1, from_io_error);
|
|
771
|
|
772 if (!DEVICE_LIVE_P (d)) /* make sure the delete-*-hook didn't
|
|
773 go ahead and delete anything */
|
|
774 {
|
|
775 UNGCPRO;
|
|
776 return;
|
|
777 }
|
|
778 }
|
|
779 }
|
|
780 #endif /* HAVE_X_WINDOWS */
|
|
781
|
|
782 DEVICE_FRAME_LOOP (frmcons, d)
|
|
783 {
|
|
784 struct frame *f = XFRAME (XCAR (frmcons));
|
|
785 /* delete_frame_internal() might do anything such as run hooks,
|
|
786 so be defensive. */
|
|
787 if (FRAME_LIVE_P (f))
|
|
788 delete_frame_internal (f, 1, 1, from_io_error);
|
|
789
|
|
790 if (!DEVICE_LIVE_P (d)) /* make sure the delete-*-hook didn't
|
|
791 go ahead and delete anything */
|
|
792 {
|
|
793 UNGCPRO;
|
|
794 return;
|
|
795 }
|
|
796 }
|
|
797 }
|
|
798
|
|
799 set_device_selected_frame (d, Qnil);
|
|
800
|
|
801 /* try to select another device */
|
|
802
|
|
803 if (EQ (device, Fselected_device (DEVICE_CONSOLE (d))))
|
|
804 {
|
|
805 Lisp_Object other_dev = find_other_device (device, 1);
|
|
806 if (!NILP (other_dev))
|
|
807 Fselect_device (other_dev);
|
|
808 }
|
|
809
|
|
810 if (EQ (device, Vdefault_device))
|
|
811 Vdefault_device = find_other_device (device, 0);
|
|
812
|
|
813 MAYBE_DEVMETH (d, delete_device, (d));
|
|
814
|
|
815 CONSOLE_DEVICE_LIST (c) = delq_no_quit (device, CONSOLE_DEVICE_LIST (c));
|
|
816 RESET_CHANGED_SET_FLAGS;
|
|
817 d->devmeths = dead_console_methods;
|
|
818 UNGCPRO;
|
|
819 }
|
|
820
|
|
821 /* delete a device as a result of an I/O error. Called from
|
|
822 an enqueued magic-eval event. */
|
|
823
|
|
824 void
|
|
825 io_error_delete_device (Lisp_Object device)
|
|
826 {
|
|
827 delete_device_internal (XDEVICE (device), 1, 0, 1);
|
|
828 }
|
|
829
|
20
|
830 DEFUN ("delete-device", Fdelete_device, 1, 2, 0, /*
|
0
|
831 Delete DEVICE, permanently eliminating it from use.
|
|
832 Normally, you cannot delete the last non-minibuffer-only frame (you must
|
|
833 use `save-buffers-kill-emacs' or `kill-emacs'). However, if optional
|
|
834 second argument FORCE is non-nil, you can delete the last frame. (This
|
|
835 will automatically call `save-buffers-kill-emacs'.)
|
20
|
836 */
|
|
837 (device, force))
|
0
|
838 {
|
|
839 CHECK_DEVICE (device);
|
|
840 delete_device_internal (XDEVICE (device), !NILP (force), 0, 0);
|
|
841 return Qnil;
|
|
842 }
|
|
843
|
20
|
844 DEFUN ("device-frame-list", Fdevice_frame_list, 0, 1, 0, /*
|
0
|
845 Return a list of all frames on DEVICE.
|
|
846 If DEVICE is nil, the selected device will be used.
|
20
|
847 */
|
|
848 (device))
|
0
|
849 {
|
|
850 return Fcopy_sequence (DEVICE_FRAME_LIST (decode_device (device)));
|
|
851 }
|
|
852
|
20
|
853 DEFUN ("device-class", Fdevice_class, 0, 1, 0, /*
|
0
|
854 Return the class (color behavior) of DEVICE.
|
|
855 This will be one of 'color, 'grayscale, or 'mono.
|
20
|
856 */
|
|
857 (device))
|
0
|
858 {
|
|
859 return DEVICE_CLASS (decode_device (device));
|
|
860 }
|
|
861
|
20
|
862 DEFUN ("set-device-class", Fset_device_class, 2, 2, 0, /*
|
0
|
863 Set the class (color behavior) of DEVICE.
|
|
864 CLASS should be one of 'color, 'grayscale, or 'mono.
|
|
865 This is only allowed on device such as TTY devices, where the color
|
|
866 behavior cannot necessarily be determined automatically.
|
20
|
867 */
|
|
868 (device, class))
|
0
|
869 {
|
|
870 struct device *d = decode_device (device);
|
|
871 XSETDEVICE (device, d);
|
|
872 if (!DEVICE_TTY_P (d))
|
|
873 signal_simple_error ("Cannot change the class of this device", device);
|
|
874 if (!EQ (class, Qcolor) && !EQ (class, Qmono) && !EQ (class, Qgrayscale))
|
|
875 signal_simple_error ("Must be color, mono, or grayscale", class);
|
|
876 DEVICE_CLASS (d) = class;
|
|
877 return Qnil;
|
|
878 }
|
|
879
|
20
|
880 DEFUN ("device-pixel-width", Fdevice_pixel_width, 0, 1, 0, /*
|
0
|
881 Return the width in pixels of DEVICE, or nil if unknown.
|
20
|
882 */
|
|
883 (device))
|
0
|
884 {
|
|
885 struct device *d = decode_device (device);
|
185
|
886 int retval = DEVMETH_OR_GIVEN (d, device_pixel_width, (d), 0);
|
0
|
887
|
185
|
888 return retval <= 0 ? Qnil : make_int (retval);
|
0
|
889 }
|
|
890
|
20
|
891 DEFUN ("device-pixel-height", Fdevice_pixel_height, 0, 1, 0, /*
|
0
|
892 Return the height in pixels of DEVICE, or nil if unknown.
|
20
|
893 */
|
|
894 (device))
|
0
|
895 {
|
|
896 struct device *d = decode_device (device);
|
185
|
897 int retval = DEVMETH_OR_GIVEN (d, device_pixel_height, (d), 0);
|
0
|
898
|
185
|
899 return retval <= 0 ? Qnil : make_int (retval);
|
0
|
900 }
|
|
901
|
20
|
902 DEFUN ("device-mm-width", Fdevice_mm_width, 0, 1, 0, /*
|
0
|
903 Return the width in millimeters of DEVICE, or nil if unknown.
|
20
|
904 */
|
|
905 (device))
|
0
|
906 {
|
|
907 struct device *d = decode_device (device);
|
185
|
908 int retval = DEVMETH_OR_GIVEN (d, device_mm_width, (d), 0);
|
0
|
909
|
185
|
910 return retval <= 0 ? Qnil : make_int (retval);
|
0
|
911 }
|
|
912
|
20
|
913 DEFUN ("device-mm-height", Fdevice_mm_height, 0, 1, 0, /*
|
0
|
914 Return the height in millimeters of DEVICE, or nil if unknown.
|
20
|
915 */
|
|
916 (device))
|
0
|
917 {
|
|
918 struct device *d = decode_device (device);
|
185
|
919 int retval = DEVMETH_OR_GIVEN (d, device_mm_height, (d), 0);
|
0
|
920
|
185
|
921 return retval <= 0 ? Qnil : make_int (retval);
|
0
|
922 }
|
|
923
|
20
|
924 DEFUN ("device-bitplanes", Fdevice_bitplanes, 0, 1, 0, /*
|
0
|
925 Return the number of bitplanes of DEVICE, or nil if unknown.
|
20
|
926 */
|
|
927 (device))
|
0
|
928 {
|
|
929 struct device *d = decode_device (device);
|
185
|
930 int retval = DEVMETH_OR_GIVEN (d, device_bitplanes, (d), 0);
|
0
|
931
|
185
|
932 return retval <= 0 ? Qnil : make_int (retval);
|
0
|
933 }
|
|
934
|
20
|
935 DEFUN ("device-color-cells", Fdevice_color_cells, 0, 1, 0, /*
|
0
|
936 Return the number of color cells of DEVICE, or nil if unknown.
|
20
|
937 */
|
|
938 (device))
|
0
|
939 {
|
|
940 struct device *d = decode_device (device);
|
185
|
941 int retval = DEVMETH_OR_GIVEN (d, device_color_cells, (d), 0);
|
0
|
942
|
185
|
943 return retval <= 0 ? Qnil : make_int (retval);
|
0
|
944 }
|
|
945
|
20
|
946 DEFUN ("set-device-baud-rate", Fset_device_baud_rate, 2, 2, 0, /*
|
0
|
947 Set the output baud rate of DEVICE to RATE.
|
|
948 On most systems, changing this value will affect the amount of padding
|
|
949 and other strategic decisions made during redisplay.
|
20
|
950 */
|
|
951 (device, rate))
|
0
|
952 {
|
|
953 CHECK_INT (rate);
|
|
954
|
|
955 DEVICE_BAUD_RATE (decode_device (device)) = XINT (rate);
|
|
956
|
|
957 return rate;
|
|
958 }
|
|
959
|
20
|
960 DEFUN ("device-baud-rate", Fdevice_baud_rate, 0, 1, 0, /*
|
0
|
961 Return the output baud rate of DEVICE.
|
20
|
962 */
|
|
963 (device))
|
0
|
964 {
|
|
965 return make_int (DEVICE_BAUD_RATE (decode_device (device)));
|
|
966 }
|
|
967
|
|
968 void
|
|
969 handle_asynch_device_change (void)
|
|
970 {
|
|
971 int i;
|
|
972 int old_asynch_device_change_pending = asynch_device_change_pending;
|
|
973 for (i = 0; i < Dynarr_length (the_console_type_entry_dynarr); i++)
|
|
974 {
|
|
975 if (Dynarr_at (the_console_type_entry_dynarr, i).meths->
|
|
976 asynch_device_change_method)
|
|
977 (Dynarr_at (the_console_type_entry_dynarr, i).meths->
|
|
978 asynch_device_change_method) ();
|
|
979 }
|
|
980 /* reset the flag to 0 unless another notification occurred while
|
|
981 we were processing this one. Block SIGWINCH during this
|
|
982 check to prevent a possible race condition. */
|
100
|
983 #ifndef WINDOWSNT
|
0
|
984 EMACS_BLOCK_SIGNAL (SIGWINCH);
|
100
|
985 #endif
|
0
|
986 if (old_asynch_device_change_pending == asynch_device_change_pending)
|
|
987 asynch_device_change_pending = 0;
|
100
|
988 #ifndef WINDOWSNT
|
0
|
989 EMACS_UNBLOCK_SIGNAL (SIGWINCH);
|
100
|
990 #endif
|
0
|
991 }
|
|
992
|
|
993 void
|
|
994 call_critical_lisp_code (struct device *d, Lisp_Object function,
|
|
995 Lisp_Object object)
|
|
996 {
|
|
997 int old_gc_currently_forbidden = gc_currently_forbidden;
|
|
998 Lisp_Object old_inhibit_quit = Vinhibit_quit;
|
|
999
|
|
1000 /* There's no reason to bother doing specbinds here, because if
|
|
1001 initialize-*-faces signals an error, emacs is going to crash
|
|
1002 immediately.
|
|
1003 */
|
|
1004 gc_currently_forbidden = 1;
|
|
1005 Vinhibit_quit = Qt;
|
|
1006 LOCK_DEVICE (d);
|
|
1007
|
|
1008 /* But it's useful to have an error handler; otherwise an infinite
|
|
1009 loop may result. */
|
|
1010 if (!NILP (object))
|
|
1011 call1_with_handler (Qreally_early_error_handler, function, object);
|
|
1012 else
|
|
1013 call0_with_handler (Qreally_early_error_handler, function);
|
185
|
1014
|
0
|
1015 UNLOCK_DEVICE (d);
|
|
1016 Vinhibit_quit = old_inhibit_quit;
|
|
1017 gc_currently_forbidden = old_gc_currently_forbidden;
|
|
1018 }
|
|
1019
|
|
1020
|
|
1021 /************************************************************************/
|
|
1022 /* initialization */
|
|
1023 /************************************************************************/
|
|
1024
|
|
1025 void
|
|
1026 syms_of_device (void)
|
|
1027 {
|
20
|
1028 DEFSUBR (Fvalid_device_class_p);
|
|
1029 DEFSUBR (Fdevice_class_list);
|
0
|
1030
|
20
|
1031 DEFSUBR (Fdfw_device);
|
|
1032 DEFSUBR (Fselected_device);
|
|
1033 DEFSUBR (Fselect_device);
|
|
1034 DEFSUBR (Fset_device_selected_frame);
|
|
1035 DEFSUBR (Fdevicep);
|
|
1036 DEFSUBR (Fdevice_live_p);
|
|
1037 DEFSUBR (Fdevice_name);
|
|
1038 DEFSUBR (Fdevice_connection);
|
|
1039 DEFSUBR (Fdevice_console);
|
|
1040 DEFSUBR (Ffind_device);
|
|
1041 DEFSUBR (Fget_device);
|
|
1042 DEFSUBR (Fmake_device);
|
|
1043 DEFSUBR (Fdelete_device);
|
|
1044 DEFSUBR (Fdevice_frame_list);
|
|
1045 DEFSUBR (Fdevice_class);
|
|
1046 DEFSUBR (Fset_device_class);
|
|
1047 DEFSUBR (Fdevice_pixel_width);
|
|
1048 DEFSUBR (Fdevice_pixel_height);
|
|
1049 DEFSUBR (Fdevice_mm_width);
|
|
1050 DEFSUBR (Fdevice_mm_height);
|
|
1051 DEFSUBR (Fdevice_bitplanes);
|
|
1052 DEFSUBR (Fdevice_color_cells);
|
|
1053 DEFSUBR (Fset_device_baud_rate);
|
|
1054 DEFSUBR (Fdevice_baud_rate);
|
0
|
1055
|
|
1056 defsymbol (&Qdevicep, "devicep");
|
|
1057 defsymbol (&Qdevice_live_p, "device-live-p");
|
|
1058 defsymbol (&Qdelete_device, "delete-device");
|
|
1059
|
|
1060 defsymbol (&Qcreate_device_hook, "create-device-hook");
|
|
1061 defsymbol (&Qdelete_device_hook, "delete-device-hook");
|
|
1062
|
|
1063 /* Qcolor defined in general.c */
|
|
1064 defsymbol (&Qgrayscale, "grayscale");
|
|
1065 defsymbol (&Qmono, "mono");
|
|
1066 }
|
|
1067
|
|
1068 void
|
|
1069 vars_of_device (void)
|
|
1070 {
|
|
1071 DEFVAR_LISP ("create-device-hook", &Vcreate_device_hook /*
|
|
1072 Function or functions to call when a device is created.
|
|
1073 One argument, the newly-created device.
|
|
1074 This is called after the first frame has been created, but before
|
|
1075 calling the `create-frame-hook'.
|
|
1076 Note that in general the device will not be selected.
|
|
1077 */ );
|
|
1078 Vcreate_device_hook = Qnil;
|
|
1079
|
|
1080 DEFVAR_LISP ("delete-device-hook", &Vdelete_device_hook /*
|
|
1081 Function or functions to call when a device is deleted.
|
|
1082 One argument, the to-be-deleted device.
|
|
1083 */ );
|
|
1084 Vdelete_device_hook = Qnil;
|
|
1085
|
|
1086 staticpro (&Vdefault_device);
|
|
1087 Vdefault_device = Qnil;
|
|
1088
|
|
1089 asynch_device_change_pending = 0;
|
|
1090
|
|
1091 Vdevice_class_list = list3 (Qcolor, Qgrayscale, Qmono);
|
|
1092 staticpro (&Vdevice_class_list);
|
|
1093 }
|