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