comparison src/objects.c @ 185:3d6bfa290dbd r20-3b19

Import from CVS: tag r20-3b19
author cvs
date Mon, 13 Aug 2007 09:55:28 +0200
parents 8eaf7971accc
children 0e522484dd2a
comparison
equal deleted inserted replaced
184:bcd2674570bf 185:3d6bfa290dbd
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_Record, ptr); 46 XSETOBJ (obj, Lisp_Type_Record, 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
156 int retval = 0; 156 int retval = 0;
157 157
158 CHECK_STRING (name); 158 CHECK_STRING (name);
159 XSETDEVICE (device, decode_device (device)); 159 XSETDEVICE (device, decode_device (device));
160 160
161 c = alloc_lcrecord (sizeof (struct Lisp_Color_Instance), 161 c = alloc_lcrecord_type (struct Lisp_Color_Instance, lrecord_color_instance);
162 lrecord_color_instance);
163 c->name = name; 162 c->name = name;
164 c->device = device; 163 c->device = device;
165 164
166 c->data = 0; 165 c->data = 0;
167 166
334 else if (!STRINGP (name)) 333 else if (!STRINGP (name))
335 return Qnil; 334 return Qnil;
336 335
337 XSETDEVICE (device, decode_device (device)); 336 XSETDEVICE (device, decode_device (device));
338 337
339 f = alloc_lcrecord (sizeof (struct Lisp_Font_Instance), 338 f = alloc_lcrecord_type (struct Lisp_Font_Instance, lrecord_font_instance);
340 lrecord_font_instance);
341 f->name = name; 339 f->name = name;
342 f->device = device; 340 f->device = device;
343 341
344 f->data = 0; 342 f->data = 0;
345 343
628 DEFUN ("color-specifier-p", Fcolor_specifier_p, 1, 1, 0, /* 626 DEFUN ("color-specifier-p", Fcolor_specifier_p, 1, 1, 0, /*
629 Return non-nil if OBJECT is a color specifier. 627 Return non-nil if OBJECT is a color specifier.
630 628
631 Valid instantiators for color specifiers are: 629 Valid instantiators for color specifiers are:
632 630
633 -- a string naming a color (e.g. under X this might be \"lightseagreen2\" 631 -- a string naming a color (e.g. under X this might be "lightseagreen2"
634 or \"#F534B2\") 632 or "#F534B2")
635 -- a color instance (use that instance directly if the device matches, 633 -- a color instance (use that instance directly if the device matches,
636 or use the string that generated it) 634 or use the string that generated it)
637 -- a vector of no elements (only on TTY's; this means to set no color 635 -- a vector of no elements (only on TTY's; this means to set no color
638 at all, thus using the \"natural\" color of the terminal's text) 636 at all, thus using the "natural" color of the terminal's text)
639 -- a vector of one or two elements: a face to inherit from, and 637 -- a vector of one or two elements: a face to inherit from, and
640 optionally a symbol naming which property of that face to inherit, 638 optionally a symbol naming which property of that face to inherit,
641 either `foreground' or `background' (if omitted, defaults to the same 639 either `foreground' or `background' (if omitted, defaults to the same
642 property that this color specifier is used for; if this specifier is 640 property that this color specifier is used for; if this specifier is
643 not part of a face, the instantiator would not be valid) 641 not part of a face, the instantiator would not be valid)
839 Return non-nil if OBJECT is a font specifier. 837 Return non-nil if OBJECT is a font specifier.
840 838
841 Valid instantiators for font specifiers are: 839 Valid instantiators for font specifiers are:
842 840
843 -- a string naming a font (e.g. under X this might be 841 -- a string naming a font (e.g. under X this might be
844 \"-*-courier-medium-r-*-*-*-140-*-*-*-*-iso8859-*\" for a 14-point 842 "-*-courier-medium-r-*-*-*-140-*-*-*-*-iso8859-*" for a 14-point
845 upright medium-weight Courier font) 843 upright medium-weight Courier font)
846 -- a font instance (use that instance directly if the device matches, 844 -- a font instance (use that instance directly if the device matches,
847 or use the string that generated it) 845 or use the string that generated it)
848 -- a vector of no elements (only on TTY's; this means to set no font 846 -- a vector of no elements (only on TTY's; this means to set no font
849 at all, thus using the \"natural\" font of the terminal's text) 847 at all, thus using the "natural" font of the terminal's text)
850 -- a vector of one element (a face to inherit from) 848 -- a vector of one element (a face to inherit from)
851 */ 849 */
852 (object)) 850 (object))
853 { 851 {
854 return FONT_SPECIFIERP (object) ? Qt : Qnil; 852 return FONT_SPECIFIERP (object) ? Qt : Qnil;
1069 void 1067 void
1070 vars_of_objects (void) 1068 vars_of_objects (void)
1071 { 1069 {
1072 staticpro (&Vthe_null_color_instance); 1070 staticpro (&Vthe_null_color_instance);
1073 { 1071 {
1074 struct Lisp_Color_Instance *c; 1072 struct Lisp_Color_Instance *c =
1075 1073 alloc_lcrecord_type (struct Lisp_Color_Instance, lrecord_color_instance);
1076 c = alloc_lcrecord (sizeof (struct Lisp_Color_Instance),
1077 lrecord_color_instance);
1078 c->name = Qnil; 1074 c->name = Qnil;
1079 c->device = Qnil; 1075 c->device = Qnil;
1080 c->data = 0; 1076 c->data = 0;
1081 1077
1082 XSETCOLOR_INSTANCE (Vthe_null_color_instance, c); 1078 XSETCOLOR_INSTANCE (Vthe_null_color_instance, c);
1083 } 1079 }
1084 1080
1085 staticpro (&Vthe_null_font_instance); 1081 staticpro (&Vthe_null_font_instance);
1086 { 1082 {
1087 struct Lisp_Font_Instance *f; 1083 struct Lisp_Font_Instance *f =
1088 1084 alloc_lcrecord_type (struct Lisp_Font_Instance, lrecord_font_instance);
1089 f = alloc_lcrecord (sizeof (struct Lisp_Font_Instance),
1090 lrecord_font_instance);
1091 f->name = Qnil; 1085 f->name = Qnil;
1092 f->device = Qnil; 1086 f->device = Qnil;
1093 f->data = 0; 1087 f->data = 0;
1094 1088
1095 f->ascent = f->height = 0; 1089 f->ascent = f->height = 0;