comparison src/glyphs.c @ 249:83b3d10dcba9 r20-5b23

Import from CVS: tag r20-5b23
author cvs
date Mon, 13 Aug 2007 10:19:09 +0200
parents 2c611d1463a6
children b2472a1930f2
comparison
equal deleted inserted replaced
248:ad40ac2754d8 249:83b3d10dcba9
2055 Lisp_Object 2055 Lisp_Object
2056 allocate_glyph (enum glyph_type type, 2056 allocate_glyph (enum glyph_type type,
2057 void (*after_change) (Lisp_Object glyph, Lisp_Object property, 2057 void (*after_change) (Lisp_Object glyph, Lisp_Object property,
2058 Lisp_Object locale)) 2058 Lisp_Object locale))
2059 { 2059 {
2060 /* This function can GC */
2060 Lisp_Object obj = Qnil; 2061 Lisp_Object obj = Qnil;
2061 struct Lisp_Glyph *g = 2062 struct Lisp_Glyph *g =
2062 alloc_lcrecord_type (struct Lisp_Glyph, lrecord_glyph); 2063 alloc_lcrecord_type (struct Lisp_Glyph, lrecord_glyph);
2063 2064
2064 g->type = type; 2065 g->type = type;
2065 g->image = Fmake_specifier (Qimage); 2066 g->image = Fmake_specifier (Qimage); /* This function can GC */
2066 switch (g->type) 2067 switch (g->type)
2067 { 2068 {
2068 case GLYPH_BUFFER: 2069 case GLYPH_BUFFER:
2069 XIMAGE_SPECIFIER_ALLOWED (g->image) = 2070 XIMAGE_SPECIFIER_ALLOWED (g->image) =
2070 IMAGE_NOTHING_MASK | IMAGE_TEXT_MASK | IMAGE_MONO_PIXMAP_MASK | 2071 IMAGE_NOTHING_MASK | IMAGE_TEXT_MASK | IMAGE_MONO_PIXMAP_MASK |
2080 break; 2081 break;
2081 default: 2082 default:
2082 abort (); 2083 abort ();
2083 } 2084 }
2084 2085
2085 set_specifier_fallback (g->image, list1 (Fcons (Qnil, Vthe_nothing_vector))); 2086 /* I think Fmake_specifier can GC. I think set_specifier_fallback can GC. */
2086 g->contrib_p = Fmake_specifier (Qboolean); 2087 /* We're getting enough reports of odd behavior in this area it seems */
2087 set_specifier_fallback (g->contrib_p, list1 (Fcons (Qnil, Qt))); 2088 /* best to GCPRO everything. */
2088 /* #### should have a specifier for the following */ 2089 {
2089 g->baseline = Fmake_specifier (Qgeneric); 2090 Lisp_Object tem1 = list1 (Fcons (Qnil, Vthe_nothing_vector));
2090 set_specifier_fallback (g->baseline, list1 (Fcons (Qnil, Qnil))); 2091 Lisp_Object tem2 = list1 (Fcons (Qnil, Qt));
2091 g->face = Qnil; 2092 Lisp_Object tem3 = list1 (Fcons (Qnil, Qnil));
2092 g->plist = Qnil; 2093 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
2093 g->after_change = after_change; 2094
2094 XSETGLYPH (obj, g); 2095 GCPRO4 (obj, tem1, tem2, tem3);
2095 2096
2096 set_image_attached_to (g->image, obj, Qimage); 2097 set_specifier_fallback (g->image, tem1);
2098 g->contrib_p = Fmake_specifier (Qboolean);
2099 set_specifier_fallback (g->contrib_p, tem2);
2100 /* #### should have a specifier for the following */
2101 g->baseline = Fmake_specifier (Qgeneric);
2102 set_specifier_fallback (g->baseline, tem3);
2103 g->face = Qnil;
2104 g->plist = Qnil;
2105 g->after_change = after_change;
2106 XSETGLYPH (obj, g);
2107
2108 set_image_attached_to (g->image, obj, Qimage);
2109 UNGCPRO;
2110 }
2097 2111
2098 return obj; 2112 return obj;
2099 } 2113 }
2100 2114
2101 static enum glyph_type 2115 static enum glyph_type
2851 } 2865 }
2852 2866
2853 void 2867 void
2854 specifier_vars_of_glyphs (void) 2868 specifier_vars_of_glyphs (void)
2855 { 2869 {
2870 /* #### Can we GC here? The set_specifier_* calls definitely need */
2871 /* protection. */
2856 /* display tables */ 2872 /* display tables */
2857 2873
2858 DEFVAR_SPECIFIER ("current-display-table", &Vcurrent_display_table /* 2874 DEFVAR_SPECIFIER ("current-display-table", &Vcurrent_display_table /*
2859 *The display table currently in use. 2875 *The display table currently in use.
2860 This is a specifier; use `set-specifier' to change it. 2876 This is a specifier; use `set-specifier' to change it.