Mercurial > hg > xemacs-beta
comparison src/device.c @ 872:79c6ff3eef26
[xemacs-hg @ 2002-06-20 21:18:01 by ben]
font changes etc.; some 21.4 changes
mule/mule-msw-init-late.el: Specify charset->windows-registry conversion.
mule/mule-x-init.el: Delete extra mule font additions here. Put them in faces.c.
cl-macs.el: Document better.
font-lock.el: Move Lisp function regexp to lisp-mode.el.
lisp-mode.el: Various indentation fixes:
Handle flet functions better.
Handle argument lists in defuns and flets.
Handle quoted lists, e.g. property lists -- don't indent like
function calls. Distinguish between lambdas and other lists.
lisp-mode.el: Handle this form.
faces.el, font-menu.el, font.el, gtk-faces.el, msw-faces.el, msw-font-menu.el, x-faces.el, x-init.el: Major overhaul of face-handling code:
-- Fix lots of bogus code in msw-faces.el, msw-font-menu.el,
font-menu.el that was "truenaming" font specs -- i.e. in the
process of frobbing a particular field in a general user-specified
font spec with wildcarded fields, sticking in particular values
for all the remaining wildcarded fields. This bug was rampant
everywhere except in x-faces.el (the oldest and only correctly
written code). This also means that we need to work with font
names at all times and not font instances, because a font instance
is essentially a truenamed font.
-- Total rewrite of extremely junky code in msw-faces.el. Work
with names as well as font instances, and return names; stop
truenaming when canonicalizing and frobbing; fix handling of the
combined style field, i.e. weight/slant (also fixed in font.el).
-- Totally rewrite the frobbing functions in faces.el. This time,
we frob all the instantiators rather than just computing a single
instance value and working backwards. That way, e.g., `bold' will
work for all charsets that have bold available, rather than only
for whatever charset was part of the computed font instance
(another example of the truename virus). Also fix up code to look
at the fallbacks (all of them) when no global value present, so we
don't need to put something in the global value. Intelligently
handle a request to frob a buffer locale, rather than signalling
an error. When frobbing instantiators, try hard to figure out
what device type is associated with them, and frob each according
to its own proper device type. Correctly handle inheritance
vectors given as instantiators. Preserve existing tags when
putting back frobbed instantiators. Extract out general
specifier-frobbing code into specifier.el. Document everything
cleanly. Do lots of other things better, etc.
-- Don't duplicatively set a global specification for the default
font -- it's already in the fallback and we no longer need a
default global specification present. Delete various code in
x-faces.el and msw-faces.el that duplicated the lists of fonts in
faces.c.
-- init-global-faces was not being called at all under MS Windows!
Major bogosity. That caused device-specific values to get stuck
into all the fonts, making it very hard to change them -- setting
global specs caused nothing to happen.
-- Correct weight names in font.el.
-- Lots more font fixups in objects*.c.
Printer.el: Warning fix.
specifier.el: Add more args to map-specifier.
Add various "heuristic" specifier functions to aid in creation of
specifier-munging code such as in faces.el.
subr.el: New functions.
lwlib.c: Fix warning.
config.inc.samp: Clean up, add args to control fastcall (not yet supported! the
changes needed are in another ws of mine), profile support, vc6
support, union-type.
xemacs.dsp, xemacs.mak: Semi-major overhaul.
Fix bug where dump-id was always getting recomputed, forcing a
redump even when nothing changed.
Add support for fastcall. Support edit-and-continue (on by
default) with vc6. Use incremental linking when doing a debug
compilation. Add support for profiling.
Consolidate the various debug flags.
Partial support for "batch-compiling" -- compiling many files on a
single invocation of the compiler. Doesn't seem to help that much
for me, so it's not finished or enabled by default.
Remove HAVE_MSW_C_DIRED, we always do.
Correct some sloppy use of directories.
s/cygwin32.h: Allow pdump to work under Cygwin (mmap is broken, so need to undefine
HAVE_MMAP).
s/win32-common.h, s/windowsnt.h: Support for fastcall. Add WIN32_ANY for identifying all Win32
variants (Cygwin, native, MinGW). Both of these are properly used
in another ws.
alloc.c, balloon-x.c, buffer.c, bytecode.c, callint.c, cm.c, cmdloop.c, cmds.c, console-gtk.c, console-gtk.h, console-msw.c, console-msw.h, console-stream.c, console-stream.h, console-tty.c, console-tty.h, console-x.c, console-x.h, console.c, console.h, device-gtk.c, device-msw.c, device-tty.c, device-x.c, device.c, device.h, devslots.h, dialog-gtk.c, dialog-msw.c, dialog-x.c, dialog.c, dired-msw.c, editfns.c, emacs.c, event-Xt.c, event-gtk.c, event-msw.c, event-stream.c, event-tty.c, event-unixoid.c, events.c, extents.c, extents.h, faces.c, fileio.c, fns.c, frame-gtk.c, frame-msw.c, frame-tty.c, frame-x.c, frame.c, frame.h, glyphs-eimage.c, glyphs-gtk.c, glyphs-msw.c, glyphs-widget.c, glyphs-x.c, glyphs.c, glyphs.h, gui-gtk.c, gui-msw.c, gui-x.c, gui.c, gutter.c, input-method-xlib.c, intl-encap-win32.c, intl-win32.c, keymap.c, lisp.h, macros.c, menubar-gtk.c, menubar-msw.c, menubar-x.c, menubar.c, menubar.h, minibuf.c, mule-charset.c, nt.c, objects-gtk.c, objects-gtk.h, objects-msw.c, objects-msw.h, objects-tty.c, objects-tty.h, objects-x.c, objects-x.h, objects.c, objects.h, postgresql.c, print.c, process.h, redisplay-gtk.c, redisplay-msw.c, redisplay-output.c, redisplay-tty.c, redisplay-x.c, redisplay.c, redisplay.h, scrollbar-gtk.c, scrollbar-msw.c, scrollbar-x.c, scrollbar.c, select-gtk.c, select-msw.c, select-x.c, select.c, signal.c, sound.c, specifier.c, symbols.c, syntax.c, sysdep.c, syssignal.h, syswindows.h, toolbar-common.c, toolbar-gtk.c, toolbar-msw.c, toolbar-x.c, toolbar.c, unicode.c, window.c, window.h: The following are the major changes made:
(1) Separation of various header files into an external and an
internal version, similar to the existing separation of process.h
and procimpl.h. Eventually this should be done for all Lisp
objects. The external version has the same name as currently; the
internal adds -impl. The external file has XFOO() macros for
objects, but the structure is opaque and defined only in the
internal file. It's now reasonable to move all prototypes in
lisp.h into the appropriate external file, and this should be
done. Currently, separation has been done on extents.h,
objects*.h, console.h, device.h, frame.h, and window.h.
For c/d/f/w, the most basic properties are available in the
external header file, with the macros resolving to functions. In
the internal header file, the macros are redefined to directly
access the structure. Also, the global MARK_FOO_CHANGED macros
have been made into functions so that they can be accessed without
needing to include lots of -impl headers -- they are used in
almost exclusively in non-time-critical functions, and take up
enough time that the function overhead will be negligible.
Similarly, the function overhead from making the basic properties
mentioned above into functions is negligible, and code that does
heavy accessing of c/d/f/w structures inevitably ends up needing
the internal header files, anyway.
(2) More face changes.
-- Major rewrite of objects-msw.c. Now handles wildcard specs
properly, rather than "truenaming" (or even worse, signalling an
error, which previously happened with some of the fallbacks if you
tried to use them in make-font-instance!).
-- Split charset matching of fonts into two stages -- one to find
a font specifically designed for a particular charset (by
examining its registry), the second to find a Unicode font that
can support the charset. This needs to proceed as two complete,
separate instantiations in order to work properly (otherwise many
of the fonts in the HELLO page look wrong). This should also make
it easy to support iso10646 (Unicode) fonts under X.
-- All default values for fonts are now completely specified in
the fallbacks. Stuff from mule-x-init.el has all been moved here,
merged with the existing specs, and totally rethought so you get
sensible results. (HELLO now looks much better!).
-- Generalize the "default X/GTK device" stuff into a
per-device-type "default device".
-- Add mswindows-{set-}charset-registry. In time,
charset<->code-page conversion functions will be removed.
-- Wrap protective code around calls to compute device specifier tags,
and do this computation before calling the face initialization code
because the latter may need these tags to be correctly updated.
(3) Other changes.
EmacsFrame.c, glyphs-msw.c, eval.c, gui-x.c, intl-encap-win32.c, search.c, signal.c, toolbar-msw.c, unicode.c: Warning fixes.
config.h.in: #undefs meant to be frobbed by configure *MUST* go inside of
#ifndef WIN32_NO_CONFIGURE, and everything else *MUST* go outside!
eval.c: Let detailed backtraces be detailed.
specifier.c: Don't override user's print-string-length/print-length settings.
glyphs.c: New function image-instance-instantiator.
config.h.in, sysdep.c: Changes for fastcall.
sysdep.c, nt.c: Fix up a previous botched patch that tried to add support for both
EEXIST and EACCES. IF THE BOTCHED PATCH WENT INTO 21.4, THIS FIXUP
NEEDS TO GO IN, TOO.
search.c: Fix *evil* crash due to incorrect synching of syntax-cache code
with 21.1. THIS SHOULD GO INTO 21.4.
author | ben |
---|---|
date | Thu, 20 Jun 2002 21:19:10 +0000 |
parents | 2b6fa2618f76 |
children | c925bacdda60 |
comparison
equal
deleted
inserted
replaced
871:732270854293 | 872:79c6ff3eef26 |
---|---|
30 #include <config.h> | 30 #include <config.h> |
31 #include "lisp.h" | 31 #include "lisp.h" |
32 | 32 |
33 #include "buffer.h" | 33 #include "buffer.h" |
34 #include "console.h" | 34 #include "console.h" |
35 #include "device.h" | 35 #include "device-impl.h" |
36 #include "elhash.h" | 36 #include "elhash.h" |
37 #include "events.h" | 37 #include "events.h" |
38 #include "faces.h" | 38 #include "faces.h" |
39 #include "frame.h" | 39 #include "frame-impl.h" |
40 #include "keymap.h" | 40 #include "keymap.h" |
41 #include "objects.h" | |
41 #include "redisplay.h" | 42 #include "redisplay.h" |
42 #include "specifier.h" | 43 #include "specifier.h" |
43 #include "sysdep.h" | 44 #include "sysdep.h" |
44 #include "toolbar.h" | 45 #include "toolbar.h" |
45 #include "window.h" | 46 #include "window.h" |
51 #include "syssignal.h" | 52 #include "syssignal.h" |
52 | 53 |
53 /* Vdefault_device is the firstly-created non-stream device that's still | 54 /* Vdefault_device is the firstly-created non-stream device that's still |
54 around. We don't really use it anywhere currently, but it might | 55 around. We don't really use it anywhere currently, but it might |
55 be used for resourcing at some point. (Currently we use | 56 be used for resourcing at some point. (Currently we use |
56 Vdefault_x_device.) */ | 57 the default X device -- see Vdefault_device_plist.) */ |
57 Lisp_Object Vdefault_device; | 58 Lisp_Object Vdefault_device; |
58 | 59 |
59 Lisp_Object Vcreate_device_hook, Vdelete_device_hook; | 60 Lisp_Object Vcreate_device_hook, Vdelete_device_hook; |
61 | |
62 static Lisp_Object Vdefault_device_plist; | |
60 | 63 |
61 /* Device classes */ | 64 /* Device classes */ |
62 /* Qcolor defined in general.c */ | 65 /* Qcolor defined in general.c */ |
63 Lisp_Object Qgrayscale, Qmono; | 66 Lisp_Object Qgrayscale, Qmono; |
64 | 67 |
171 d->color_instance_cache = | 174 d->color_instance_cache = |
172 make_lisp_hash_table (20, HASH_TABLE_KEY_WEAK, HASH_TABLE_EQUAL); | 175 make_lisp_hash_table (20, HASH_TABLE_KEY_WEAK, HASH_TABLE_EQUAL); |
173 d->font_instance_cache = | 176 d->font_instance_cache = |
174 make_lisp_hash_table (20, HASH_TABLE_KEY_WEAK, HASH_TABLE_EQUAL); | 177 make_lisp_hash_table (20, HASH_TABLE_KEY_WEAK, HASH_TABLE_EQUAL); |
175 #ifdef MULE | 178 #ifdef MULE |
176 /* Note that the following table is bi-level. */ | 179 initialize_charset_font_caches (d); |
177 d->charset_font_cache = | |
178 make_lisp_hash_table (20, HASH_TABLE_NON_WEAK, HASH_TABLE_EQ); | |
179 #endif | 180 #endif |
180 /* | 181 /* |
181 Note that the image instance cache is actually bi-level. | 182 Note that the image instance cache is actually bi-level. |
182 See device.h. We use a low number here because most of the | 183 See device.h. We use a low number here because most of the |
183 time there aren't very many different masks that will be used. | 184 time there aren't very many different masks that will be used. |
206 Return nil otherwise. | 207 Return nil otherwise. |
207 */ | 208 */ |
208 (object)) | 209 (object)) |
209 { | 210 { |
210 return DFW_DEVICE (object); | 211 return DFW_DEVICE (object); |
212 } | |
213 | |
214 Lisp_Object | |
215 device_console (struct device *d) | |
216 { | |
217 return DEVICE_CONSOLE (d); | |
218 } | |
219 | |
220 int | |
221 device_live_p (struct device *d) | |
222 { | |
223 return DEVICE_LIVE_P (d); | |
224 } | |
225 | |
226 Lisp_Object | |
227 device_frame_list (struct device *d) | |
228 { | |
229 return DEVICE_FRAME_LIST (d); | |
211 } | 230 } |
212 | 231 |
213 | 232 |
214 DEFUN ("selected-device", Fselected_device, 0, 1, 0, /* | 233 DEFUN ("selected-device", Fselected_device, 0, 1, 0, /* |
215 Return the device which is currently active. | 234 Return the device which is currently active. |
331 (device)) | 350 (device)) |
332 { | 351 { |
333 return DEVICE_CONSOLE (decode_device (device)); | 352 return DEVICE_CONSOLE (decode_device (device)); |
334 } | 353 } |
335 | 354 |
336 #ifdef HAVE_WINDOW_SYSTEM | |
337 | |
338 static void | 355 static void |
339 init_global_resources (struct device *d) | 356 init_global_resources (struct device *d) |
340 { | 357 { |
341 init_global_faces (d); | 358 init_global_faces (d); |
342 #ifdef HAVE_SCROLLBARS | 359 #ifdef HAVE_SCROLLBARS |
345 #ifdef HAVE_TOOLBARS | 362 #ifdef HAVE_TOOLBARS |
346 init_global_toolbars (d); | 363 init_global_toolbars (d); |
347 #endif | 364 #endif |
348 } | 365 } |
349 | 366 |
350 #endif | |
351 | |
352 static void | 367 static void |
353 init_device_resources (struct device *d) | 368 init_device_resources (struct device *d) |
354 { | 369 { |
355 init_device_faces (d); | 370 init_device_faces (d); |
356 #ifdef HAVE_SCROLLBARS | 371 #ifdef HAVE_SCROLLBARS |
357 init_device_scrollbars (d); | 372 init_device_scrollbars (d); |
358 #endif | 373 #endif |
359 #ifdef HAVE_TOOLBARS | 374 #ifdef HAVE_TOOLBARS |
360 init_device_toolbars (d); | 375 init_device_toolbars (d); |
361 #endif | 376 #endif |
377 } | |
378 | |
379 DEFUN ("default-device", Fdefault_device, 0, 1, 0, /* | |
380 Return the default device of type TYPE. | |
381 This is generally the first-created device of that TYPE that still exists. | |
382 It is used for resourcing and certain other things. On MS Windows, it | |
383 is not very useful because there is generally only one device. | |
384 If TYPE is omitted, it is derived from the selected device. | |
385 If there is no default device of TYPE, nil is returned. | |
386 */ | |
387 (type)) | |
388 { | |
389 if (NILP (type)) | |
390 type = XDEVICE_TYPE (Fselected_device (Qnil)); | |
391 else | |
392 /* For errors */ | |
393 decode_console_type (type, ERROR_ME); | |
394 | |
395 return Fplist_get (Vdefault_device_plist, type, Qnil); | |
396 } | |
397 | |
398 /* Return the default device for a device type. */ | |
399 Lisp_Object | |
400 get_default_device (Lisp_Object type) | |
401 { | |
402 return Fplist_get (Vdefault_device_plist, type, Qnil); | |
403 } | |
404 | |
405 /* Set the default device for a device type. */ | |
406 void | |
407 set_default_device (Lisp_Object type, Lisp_Object device) | |
408 { | |
409 Vdefault_device_plist = Fplist_put (Vdefault_device_plist, type, device); | |
410 } | |
411 | |
412 void | |
413 clear_default_devices (void) | |
414 { | |
415 Vdefault_device_plist = Qnil; | |
362 } | 416 } |
363 | 417 |
364 static Lisp_Object | 418 static Lisp_Object |
365 semi_canonicalize_device_connection (struct console_methods *meths, | 419 semi_canonicalize_device_connection (struct console_methods *meths, |
366 Lisp_Object name, Error_Behavior errb) | 420 Lisp_Object name, Error_Behavior errb) |
508 Lisp_Object name = Qnil; | 562 Lisp_Object name = Qnil; |
509 struct console_methods *conmeths; | 563 struct console_methods *conmeths; |
510 int speccount = specpdl_depth(); | 564 int speccount = specpdl_depth(); |
511 | 565 |
512 struct gcpro gcpro1, gcpro2, gcpro3; | 566 struct gcpro gcpro1, gcpro2, gcpro3; |
513 #ifdef HAVE_X_WINDOWS | 567 /* If this is the first device we are creating of a particular type |
514 /* #### icky-poo. If this is the first X device we are creating, | 568 (e.g. X), then retrieve the global face resources. We have to do it |
515 then retrieve the global face resources. We have to do it | 569 here, at the same time as (or just before) the device face resources |
516 here, at the same time as (or just before) the device face | 570 are retrieved; specifically, it needs to be done after the device has |
517 resources are retrieved; specifically, it needs to be done | 571 been created but before any frames have been popped up or much |
518 after the device has been created but before any frames have | 572 anything else has been done. It's possible for other devices to |
519 been popped up or much anything else has been done. It's | 573 specify different global resources (there's a property on each X |
520 possible for other devices to specify different global | 574 server's root window that holds some resources); tough luck for the |
521 resources (there's a property on each X server's root window | 575 moment. */ |
522 that holds some resources); tough luck for the moment. | 576 int first = NILP (get_default_device (type)); |
523 | |
524 This is a nasty violation of device independence, but | |
525 there's not a whole lot I can figure out to do about it. | |
526 The real problem is that the concept of resources is not | |
527 generalized away from X. Similar resource-related | |
528 device-independence violations occur in faces.el. */ | |
529 int first_x_device = NILP (Vdefault_x_device) && EQ (type, Qx); | |
530 #endif | |
531 #ifdef HAVE_GTK | |
532 int first_gtk_device = NILP (Vdefault_gtk_device) && EQ (type, Qgtk); | |
533 #endif | |
534 | 577 |
535 GCPRO3 (device, console, name); | 578 GCPRO3 (device, console, name); |
536 | 579 |
537 conmeths = decode_console_type (type, ERROR_ME_NOT); | 580 conmeths = decode_console_type (type, ERROR_ME_NOT); |
538 if (!conmeths) | 581 if (!conmeths) |
551 (connection, ERROR_ME)) : | 594 (connection, ERROR_ME)) : |
552 connection; | 595 connection; |
553 console = create_console (name, type, conconnect, props); | 596 console = create_console (name, type, conconnect, props); |
554 } | 597 } |
555 | 598 |
556 record_unwind_protect(delete_deviceless_console, console); | 599 record_unwind_protect (delete_deviceless_console, console); |
557 | 600 |
558 con = XCONSOLE (console); | 601 con = XCONSOLE (console); |
559 d = allocate_device (console); | 602 d = allocate_device (console); |
560 device = wrap_device (d); | 603 device = wrap_device (d); |
561 | 604 |
569 | 612 |
570 MAYBE_DEVMETH (d, init_device, (d, props)); | 613 MAYBE_DEVMETH (d, init_device, (d, props)); |
571 | 614 |
572 /* Do it this way so that the device list is in order of creation */ | 615 /* Do it this way so that the device list is in order of creation */ |
573 con->device_list = nconc2 (con->device_list, Fcons (device, Qnil)); | 616 con->device_list = nconc2 (con->device_list, Fcons (device, Qnil)); |
617 | |
618 if (NILP (get_default_device (type))) | |
619 set_default_device (type, device); | |
620 | |
574 note_object_created (device); | 621 note_object_created (device); |
575 | 622 |
576 RESET_CHANGED_SET_FLAGS; | 623 RESET_CHANGED_SET_FLAGS; |
577 if (NILP (Vdefault_device) || DEVICE_STREAM_P (XDEVICE (Vdefault_device))) | 624 if (NILP (Vdefault_device) || DEVICE_STREAM_P (XDEVICE (Vdefault_device))) |
578 Vdefault_device = device; | 625 Vdefault_device = device; |
579 | 626 |
580 init_device_sound (d); | 627 init_device_sound (d); |
581 #ifdef HAVE_X_WINDOWS | |
582 if (first_x_device) | |
583 init_global_resources (d); | |
584 #endif | |
585 #ifdef HAVE_GTK | |
586 if (first_gtk_device) | |
587 init_global_resources (d); | |
588 #endif | |
589 init_device_resources (d); | |
590 | |
591 MAYBE_DEVMETH (d, finish_init_device, (d, props)); | |
592 | 628 |
593 /* If this is the first device on the console, make it the selected one. */ | 629 /* If this is the first device on the console, make it the selected one. */ |
594 if (NILP (CONSOLE_SELECTED_DEVICE (con))) | 630 if (NILP (CONSOLE_SELECTED_DEVICE (con))) |
595 CONSOLE_SELECTED_DEVICE (con) = device; | 631 CONSOLE_SELECTED_DEVICE (con) = device; |
596 | 632 |
597 /* #### the following should trap errors. */ | 633 /* Needed before initialization of resources because they may do things |
634 with the tags, esp. the face code. For example, | |
635 init-other-random-faces calls face-property-instance, and the | |
636 specifier code checks inst-pairs by seeing if the device matches the | |
637 tag; this fails for tags such as `default', if we haven't set up the | |
638 tags yet. */ | |
598 setup_device_initial_specifier_tags (d); | 639 setup_device_initial_specifier_tags (d); |
640 | |
641 if (!EQ (type, Qstream)) | |
642 { | |
643 if (first) | |
644 init_global_resources (d); | |
645 init_device_resources (d); | |
646 } | |
647 | |
648 MAYBE_DEVMETH (d, finish_init_device, (d, props)); | |
599 | 649 |
600 UNGCPRO; | 650 UNGCPRO; |
601 unbind_to (speccount); | 651 unbind_to (speccount); |
602 return device; | 652 return device; |
603 } | 653 } |
804 | 854 |
805 if (EQ (device, Vdefault_device)) | 855 if (EQ (device, Vdefault_device)) |
806 Vdefault_device = find_other_device (device, 0); | 856 Vdefault_device = find_other_device (device, 0); |
807 | 857 |
808 MAYBE_DEVMETH (d, delete_device, (d)); | 858 MAYBE_DEVMETH (d, delete_device, (d)); |
859 | |
860 /* Now see if we're the default device, and thus need to be changed. */ | |
861 { | |
862 /* Device type still OK, not set to null till down below. */ | |
863 Lisp_Object dt = DEVICE_TYPE (d); | |
864 | |
865 if (EQ (device, get_default_device (dt))) | |
866 { | |
867 Lisp_Object devcons, concons; | |
868 /* #### handle deleting last device */ | |
869 set_default_device (dt, Qnil); | |
870 DEVICE_LOOP_NO_BREAK (devcons, concons) | |
871 { | |
872 if (EQ (dt, XDEVICE_TYPE (XCAR (devcons))) && | |
873 !EQ (device, XCAR (devcons))) | |
874 { | |
875 set_default_device (dt, XCAR (devcons)); | |
876 goto double_break; | |
877 } | |
878 } | |
879 } | |
880 } | |
881 double_break: | |
809 | 882 |
810 CONSOLE_DEVICE_LIST (c) = delq_no_quit (device, CONSOLE_DEVICE_LIST (c)); | 883 CONSOLE_DEVICE_LIST (c) = delq_no_quit (device, CONSOLE_DEVICE_LIST (c)); |
811 | 884 |
812 RESET_CHANGED_SET_FLAGS; | 885 RESET_CHANGED_SET_FLAGS; |
813 | 886 |
1217 { | 1290 { |
1218 UNLOCK_DEVICE (XDEVICE (d)); | 1291 UNLOCK_DEVICE (XDEVICE (d)); |
1219 return Qnil; | 1292 return Qnil; |
1220 } | 1293 } |
1221 | 1294 |
1222 void | 1295 Lisp_Object |
1223 call_critical_lisp_code (struct device *d, Lisp_Object function, | 1296 call_critical_lisp_code (struct device *d, Lisp_Object function, |
1224 Lisp_Object object) | 1297 Lisp_Object object) |
1225 { | 1298 { |
1226 /* This function cannot GC */ | 1299 /* This function cannot GC */ |
1227 int count = begin_gc_forbidden (); | 1300 int count = begin_gc_forbidden (); |
1228 struct gcpro gcpro1; | 1301 struct gcpro gcpro1; |
1229 Lisp_Object args[3]; | 1302 Lisp_Object args[3]; |
1303 Lisp_Object retval; | |
1230 | 1304 |
1231 specbind (Qinhibit_quit, Qt); | 1305 specbind (Qinhibit_quit, Qt); |
1232 record_unwind_protect (unlock_device, wrap_device (d)); | 1306 record_unwind_protect (unlock_device, wrap_device (d)); |
1233 | 1307 |
1234 /* [[There's no real reason to bother doing unwind-protects, because if | 1308 /* [[There's no real reason to bother doing unwind-protects, because if |
1246 | 1320 |
1247 GCPRO1_ARRAY (args, 3); | 1321 GCPRO1_ARRAY (args, 3); |
1248 | 1322 |
1249 /* It's useful to have an error handler; otherwise an infinite | 1323 /* It's useful to have an error handler; otherwise an infinite |
1250 loop may result. */ | 1324 loop may result. */ |
1251 Fcall_with_condition_handler (!NILP (object) ? 3 : 2, args); | 1325 retval = Fcall_with_condition_handler (!NILP (object) ? 3 : 2, args); |
1252 | 1326 |
1253 UNGCPRO; | 1327 UNGCPRO; |
1254 | 1328 |
1255 unbind_to (count); | 1329 return unbind_to_1 (count, retval); |
1256 } | 1330 } |
1257 | 1331 |
1258 | 1332 |
1259 /************************************************************************/ | 1333 /************************************************************************/ |
1260 /* initialization */ | 1334 /* initialization */ |
1278 DEFSUBR (Fdevice_connection); | 1352 DEFSUBR (Fdevice_connection); |
1279 DEFSUBR (Fdevice_console); | 1353 DEFSUBR (Fdevice_console); |
1280 DEFSUBR (Ffind_device); | 1354 DEFSUBR (Ffind_device); |
1281 DEFSUBR (Fget_device); | 1355 DEFSUBR (Fget_device); |
1282 DEFSUBR (Fmake_device); | 1356 DEFSUBR (Fmake_device); |
1357 DEFSUBR (Fdefault_device); | |
1283 DEFSUBR (Fdelete_device); | 1358 DEFSUBR (Fdelete_device); |
1284 DEFSUBR (Fdevice_frame_list); | 1359 DEFSUBR (Fdevice_frame_list); |
1285 DEFSUBR (Fdevice_class); | 1360 DEFSUBR (Fdevice_class); |
1286 DEFSUBR (Fset_device_class); | 1361 DEFSUBR (Fset_device_class); |
1287 DEFSUBR (Fdevice_system_metrics); | 1362 DEFSUBR (Fdevice_system_metrics); |
1367 Function or functions to call when a device is deleted. | 1442 Function or functions to call when a device is deleted. |
1368 One argument, the to-be-deleted device. | 1443 One argument, the to-be-deleted device. |
1369 */ ); | 1444 */ ); |
1370 Vdelete_device_hook = Qnil; | 1445 Vdelete_device_hook = Qnil; |
1371 | 1446 |
1447 /* Plist of device types and their default devices. */ | |
1448 Vdefault_device_plist = Qnil; | |
1449 staticpro (&Vdefault_device_plist); | |
1450 | |
1372 Vdevice_class_list = list3 (Qcolor, Qgrayscale, Qmono); | 1451 Vdevice_class_list = list3 (Qcolor, Qgrayscale, Qmono); |
1373 staticpro (&Vdevice_class_list); | 1452 staticpro (&Vdevice_class_list); |
1374 | 1453 |
1375 /* Death to devices.el !!! */ | 1454 /* Death to devices.el !!! */ |
1376 Fprovide (intern ("devices")); | 1455 Fprovide (intern ("devices")); |