comparison src/objects.c @ 442:abe6d1db359e r21-2-36

Import from CVS: tag r21-2-36
author cvs
date Mon, 13 Aug 2007 11:35:02 +0200
parents 8de8e3f6228a
children 576fb035e263
comparison
equal deleted inserted replaced
441:72a7cfa4a488 442:abe6d1db359e
41 41
42 void 42 void
43 finalose (void *ptr) 43 finalose (void *ptr)
44 { 44 {
45 Lisp_Object obj; 45 Lisp_Object obj;
46 XSETOBJ (obj, Lisp_Type_Record, ptr); 46 XSETOBJ (obj, ptr);
47 47
48 signal_simple_error 48 signal_simple_error
49 ("Can't dump an emacs containing window system objects", obj); 49 ("Can't dump an emacs containing window system objects", obj);
50 } 50 }
51 51
505 Lisp_Object domain, Lisp_Object instantiator, 505 Lisp_Object domain, Lisp_Object instantiator,
506 Lisp_Object depth) 506 Lisp_Object depth)
507 { 507 {
508 /* When called, we're inside of call_with_suspended_errors(), 508 /* When called, we're inside of call_with_suspended_errors(),
509 so we can freely error. */ 509 so we can freely error. */
510 Lisp_Object device = DFW_DEVICE (domain); 510 Lisp_Object device = DOMAIN_DEVICE (domain);
511 struct device *d = XDEVICE (device); 511 struct device *d = XDEVICE (device);
512 512
513 if (COLOR_INSTANCEP (instantiator)) 513 if (COLOR_INSTANCEP (instantiator))
514 { 514 {
515 /* If we are on the same device then we're done. Otherwise change 515 /* If we are on the same device then we're done. Otherwise change
629 } 629 }
630 630
631 DEFUN ("color-specifier-p", Fcolor_specifier_p, 1, 1, 0, /* 631 DEFUN ("color-specifier-p", Fcolor_specifier_p, 1, 1, 0, /*
632 Return t if OBJECT is a color specifier. 632 Return t if OBJECT is a color specifier.
633 633
634 Valid instantiators for color specifiers are: 634 See `make-color-specifier' for a description of possible color instantiators.
635
636 -- a string naming a color (e.g. under X this might be "lightseagreen2"
637 or "#F534B2")
638 -- a color instance (use that instance directly if the device matches,
639 or use the string that generated it)
640 -- a vector of no elements (only on TTY's; this means to set no color
641 at all, thus using the "natural" color of the terminal's text)
642 -- a vector of one or two elements: a face to inherit from, and
643 optionally a symbol naming which property of that face to inherit,
644 either `foreground' or `background' (if omitted, defaults to the same
645 property that this color specifier is used for; if this specifier is
646 not part of a face, the instantiator would not be valid)
647 */ 635 */
648 (object)) 636 (object))
649 { 637 {
650 return COLOR_SPECIFIERP (object) ? Qt : Qnil; 638 return COLOR_SPECIFIERP (object) ? Qt : Qnil;
651 } 639 }
680 668
681 #ifdef MULE 669 #ifdef MULE
682 670
683 int 671 int
684 font_spec_matches_charset (struct device *d, Lisp_Object charset, 672 font_spec_matches_charset (struct device *d, Lisp_Object charset,
685 CONST Bufbyte *nonreloc, Lisp_Object reloc, 673 const Bufbyte *nonreloc, Lisp_Object reloc,
686 Bytecount offset, Bytecount length) 674 Bytecount offset, Bytecount length)
687 { 675 {
688 return DEVMETH_OR_GIVEN (d, font_spec_matches_charset, 676 return DEVMETH_OR_GIVEN (d, font_spec_matches_charset,
689 (d, charset, nonreloc, reloc, offset, length), 677 (d, charset, nonreloc, reloc, offset, length),
690 1); 678 1);
704 Lisp_Object domain, Lisp_Object instantiator, 692 Lisp_Object domain, Lisp_Object instantiator,
705 Lisp_Object depth) 693 Lisp_Object depth)
706 { 694 {
707 /* When called, we're inside of call_with_suspended_errors(), 695 /* When called, we're inside of call_with_suspended_errors(),
708 so we can freely error. */ 696 so we can freely error. */
709 Lisp_Object device = DFW_DEVICE (domain); 697 Lisp_Object device = DOMAIN_DEVICE (domain);
710 struct device *d = XDEVICE (device); 698 struct device *d = XDEVICE (device);
711 Lisp_Object instance; 699 Lisp_Object instance;
712 700
713 #ifdef MULE 701 #ifdef MULE
714 if (!UNBOUNDP (matchspec)) 702 if (!UNBOUNDP (matchspec))
839 } 827 }
840 828
841 DEFUN ("font-specifier-p", Ffont_specifier_p, 1, 1, 0, /* 829 DEFUN ("font-specifier-p", Ffont_specifier_p, 1, 1, 0, /*
842 Return non-nil if OBJECT is a font specifier. 830 Return non-nil if OBJECT is a font specifier.
843 831
844 Valid instantiators for font specifiers are: 832 See `make-font-specifier' for a description of possible font instantiators.
845
846 -- a string naming a font (e.g. under X this might be
847 "-*-courier-medium-r-*-*-*-140-*-*-*-*-iso8859-*" for a 14-point
848 upright medium-weight Courier font)
849 -- a font instance (use that instance directly if the device matches,
850 or use the string that generated it)
851 -- a vector of no elements (only on TTY's; this means to set no font
852 at all, thus using the "natural" font of the terminal's text)
853 -- a vector of one element (a face to inherit from)
854 */ 833 */
855 (object)) 834 (object))
856 { 835 {
857 return FONT_SPECIFIERP (object) ? Qt : Qnil; 836 return FONT_SPECIFIERP (object) ? Qt : Qnil;
858 } 837 }
984 } 963 }
985 964
986 DEFUN ("face-boolean-specifier-p", Fface_boolean_specifier_p, 1, 1, 0, /* 965 DEFUN ("face-boolean-specifier-p", Fface_boolean_specifier_p, 1, 1, 0, /*
987 Return non-nil if OBJECT is a face-boolean specifier. 966 Return non-nil if OBJECT is a face-boolean specifier.
988 967
989 Valid instantiators for face-boolean specifiers are 968 See `make-face-boolean-specifier' for a description of possible
990 969 face-boolean instantiators.
991 -- t or nil
992 -- a vector of two or three elements: a face to inherit from,
993 optionally a symbol naming the property of that face to inherit from
994 (if omitted, defaults to the same property that this face-boolean
995 specifier is used for; if this specifier is not part of a face,
996 the instantiator would not be valid), and optionally a value which,
997 if non-nil, means to invert the sense of the inherited property.
998 */ 970 */
999 (object)) 971 (object))
1000 { 972 {
1001 return FACE_BOOLEAN_SPECIFIERP (object) ? Qt : Qnil; 973 return FACE_BOOLEAN_SPECIFIERP (object) ? Qt : Qnil;
1002 } 974 }
1007 /************************************************************************/ 979 /************************************************************************/
1008 980
1009 void 981 void
1010 syms_of_objects (void) 982 syms_of_objects (void)
1011 { 983 {
984 INIT_LRECORD_IMPLEMENTATION (color_instance);
985 INIT_LRECORD_IMPLEMENTATION (font_instance);
986
1012 DEFSUBR (Fcolor_specifier_p); 987 DEFSUBR (Fcolor_specifier_p);
1013 DEFSUBR (Ffont_specifier_p); 988 DEFSUBR (Ffont_specifier_p);
1014 DEFSUBR (Fface_boolean_specifier_p); 989 DEFSUBR (Fface_boolean_specifier_p);
1015 990
1016 defsymbol (&Qcolor_instancep, "color-instance-p"); 991 defsymbol (&Qcolor_instancep, "color-instance-p");