Mercurial > hg > xemacs-beta
comparison src/faces.c @ 5619:75ad4969a16d
Replace the 'flush face property with the opposite 'shrink one.
lisp/ChangeLog addition:
2011-12-26 Didier Verna <didier@xemacs.org>
* cl-macs.el (face-flush-p): Removed.
* cl-macs.el (face-shrink-p): New.
* faces.el (face-flush-p): Removed.
* faces.el (face-shrink-p): New.
* faces.el (set-face-flush-p): Removed.
* faces.el (set-face-shrink-p): New.
* cus-face.el (custom-face-attributes):
* faces.el (set-face-property):
* faces.el (face-equal):
* x-faces.el (x-init-face-from-resources):
* x-faces.el (make-face-x-resource-internal): Replace the 'flush
property with the opposite 'shrink one.
src/ChangeLog addition:
2011-12-26 Didier Verna <didier@xemacs.org>
* lisp.h:
* faces.c (mark_face):
* faces.c (face_equal):
* faces.c (face_getprop):
* faces.c (face_putprop):
* faces.c (face_remprop):
* faces.c (face_plist):
* faces.c (reset_face):
* faces.c (update_face_inheritance_mapper):
* faces.c (Fmake_face):
* faces.c (update_face_cachel_data):
* faces.c (merge_face_cachel_data):
* faces.c (Fcopy_face):
* faces.c (syms_of_faces):
* faces.c (vars_of_faces):
* faces.c (complex_vars_of_faces):
* faces.h (struct Lisp_Face):
* faces.h (struct face_cachel):
* faces.h (WINDOW_FACE_CACHEL_SHRINK_P):
* faces.h (FACE_SHRINK_P):
* fontcolor.c (face_boolean_validate): Replace the 'flush property
with the opposite 'shrink one.
* redisplay.c (create_text_block):
* redisplay.c (create_string_text_block): Ditto. Invert the logic
for storing a new clear_findex in the display lines.
author | Didier Verna <didier@xemacs.org> |
---|---|
date | Mon, 26 Dec 2011 15:04:25 +0100 |
parents | b0d712bbc2a6 |
children | c39052c921b5 |
comparison
equal
deleted
inserted
replaced
5618:cc1ec4c93a67 | 5619:75ad4969a16d |
---|---|
40 #include "window.h" | 40 #include "window.h" |
41 | 41 |
42 Lisp_Object Qfacep; | 42 Lisp_Object Qfacep; |
43 Lisp_Object Qforeground, Qbackground, Qdisplay_table; | 43 Lisp_Object Qforeground, Qbackground, Qdisplay_table; |
44 Lisp_Object Qbackground_pixmap, Qbackground_placement, Qunderline, Qdim; | 44 Lisp_Object Qbackground_pixmap, Qbackground_placement, Qunderline, Qdim; |
45 Lisp_Object Qblinking, Qstrikethru, Qflush, Q_name; | 45 Lisp_Object Qblinking, Qstrikethru, Qshrink, Q_name; |
46 | 46 |
47 Lisp_Object Qinit_face_from_resources; | 47 Lisp_Object Qinit_face_from_resources; |
48 Lisp_Object Qinit_frame_faces; | 48 Lisp_Object Qinit_frame_faces; |
49 Lisp_Object Qinit_device_faces; | 49 Lisp_Object Qinit_device_faces; |
50 Lisp_Object Qinit_global_faces; | 50 Lisp_Object Qinit_global_faces; |
115 mark_object (face->strikethru); | 115 mark_object (face->strikethru); |
116 mark_object (face->highlight); | 116 mark_object (face->highlight); |
117 mark_object (face->dim); | 117 mark_object (face->dim); |
118 mark_object (face->blinking); | 118 mark_object (face->blinking); |
119 mark_object (face->reverse); | 119 mark_object (face->reverse); |
120 mark_object (face->flush); | 120 mark_object (face->shrink); |
121 | 121 |
122 mark_object (face->charsets_warned_about); | 122 mark_object (face->charsets_warned_about); |
123 | 123 |
124 return face->plist; | 124 return face->plist; |
125 } | 125 } |
170 internal_equal (f1->strikethru, f2->strikethru, depth) && | 170 internal_equal (f1->strikethru, f2->strikethru, depth) && |
171 internal_equal (f1->highlight, f2->highlight, depth) && | 171 internal_equal (f1->highlight, f2->highlight, depth) && |
172 internal_equal (f1->dim, f2->dim, depth) && | 172 internal_equal (f1->dim, f2->dim, depth) && |
173 internal_equal (f1->blinking, f2->blinking, depth) && | 173 internal_equal (f1->blinking, f2->blinking, depth) && |
174 internal_equal (f1->reverse, f2->reverse, depth) && | 174 internal_equal (f1->reverse, f2->reverse, depth) && |
175 internal_equal (f1->flush, f2->flush, depth) && | 175 internal_equal (f1->shrink, f2->shrink, depth) && |
176 | 176 |
177 ! plists_differ (f1->plist, f2->plist, 0, 0, depth + 1, 0)); | 177 ! plists_differ (f1->plist, f2->plist, 0, 0, depth + 1, 0)); |
178 } | 178 } |
179 | 179 |
180 static Hashcode | 180 static Hashcode |
207 EQ (prop, Qstrikethru) ? f->strikethru : | 207 EQ (prop, Qstrikethru) ? f->strikethru : |
208 EQ (prop, Qhighlight) ? f->highlight : | 208 EQ (prop, Qhighlight) ? f->highlight : |
209 EQ (prop, Qdim) ? f->dim : | 209 EQ (prop, Qdim) ? f->dim : |
210 EQ (prop, Qblinking) ? f->blinking : | 210 EQ (prop, Qblinking) ? f->blinking : |
211 EQ (prop, Qreverse) ? f->reverse : | 211 EQ (prop, Qreverse) ? f->reverse : |
212 EQ (prop, Qflush) ? f->flush : | 212 EQ (prop, Qshrink) ? f->shrink : |
213 EQ (prop, Qdoc_string) ? f->doc_string : | 213 EQ (prop, Qdoc_string) ? f->doc_string : |
214 external_plist_get (&f->plist, prop, 0, ERROR_ME)); | 214 external_plist_get (&f->plist, prop, 0, ERROR_ME)); |
215 } | 215 } |
216 | 216 |
217 static int | 217 static int |
229 EQ (prop, Qstrikethru) || | 229 EQ (prop, Qstrikethru) || |
230 EQ (prop, Qhighlight) || | 230 EQ (prop, Qhighlight) || |
231 EQ (prop, Qdim) || | 231 EQ (prop, Qdim) || |
232 EQ (prop, Qblinking) || | 232 EQ (prop, Qblinking) || |
233 EQ (prop, Qreverse) || | 233 EQ (prop, Qreverse) || |
234 EQ (prop, Qflush)) | 234 EQ (prop, Qshrink)) |
235 return 0; | 235 return 0; |
236 | 236 |
237 if (EQ (prop, Qdoc_string)) | 237 if (EQ (prop, Qdoc_string)) |
238 { | 238 { |
239 if (!NILP (value)) | 239 if (!NILP (value)) |
261 EQ (prop, Qstrikethru) || | 261 EQ (prop, Qstrikethru) || |
262 EQ (prop, Qhighlight) || | 262 EQ (prop, Qhighlight) || |
263 EQ (prop, Qdim) || | 263 EQ (prop, Qdim) || |
264 EQ (prop, Qblinking) || | 264 EQ (prop, Qblinking) || |
265 EQ (prop, Qreverse) || | 265 EQ (prop, Qreverse) || |
266 EQ (prop, Qflush)) | 266 EQ (prop, Qshrink)) |
267 return -1; | 267 return -1; |
268 | 268 |
269 if (EQ (prop, Qdoc_string)) | 269 if (EQ (prop, Qdoc_string)) |
270 { | 270 { |
271 f->doc_string = Qnil; | 271 f->doc_string = Qnil; |
279 face_plist (Lisp_Object obj) | 279 face_plist (Lisp_Object obj) |
280 { | 280 { |
281 Lisp_Face *face = XFACE (obj); | 281 Lisp_Face *face = XFACE (obj); |
282 Lisp_Object result = face->plist; | 282 Lisp_Object result = face->plist; |
283 | 283 |
284 result = cons3 (Qflush, face->flush, result); | 284 result = cons3 (Qshrink, face->shrink, result); |
285 result = cons3 (Qreverse, face->reverse, result); | 285 result = cons3 (Qreverse, face->reverse, result); |
286 result = cons3 (Qblinking, face->blinking, result); | 286 result = cons3 (Qblinking, face->blinking, result); |
287 result = cons3 (Qdim, face->dim, result); | 287 result = cons3 (Qdim, face->dim, result); |
288 result = cons3 (Qhighlight, face->highlight, result); | 288 result = cons3 (Qhighlight, face->highlight, result); |
289 result = cons3 (Qstrikethru, face->strikethru, result); | 289 result = cons3 (Qstrikethru, face->strikethru, result); |
311 { XD_LISP_OBJECT, offsetof (Lisp_Face, strikethru) }, | 311 { XD_LISP_OBJECT, offsetof (Lisp_Face, strikethru) }, |
312 { XD_LISP_OBJECT, offsetof (Lisp_Face, highlight) }, | 312 { XD_LISP_OBJECT, offsetof (Lisp_Face, highlight) }, |
313 { XD_LISP_OBJECT, offsetof (Lisp_Face, dim) }, | 313 { XD_LISP_OBJECT, offsetof (Lisp_Face, dim) }, |
314 { XD_LISP_OBJECT, offsetof (Lisp_Face, blinking) }, | 314 { XD_LISP_OBJECT, offsetof (Lisp_Face, blinking) }, |
315 { XD_LISP_OBJECT, offsetof (Lisp_Face, reverse) }, | 315 { XD_LISP_OBJECT, offsetof (Lisp_Face, reverse) }, |
316 { XD_LISP_OBJECT, offsetof (Lisp_Face, flush) }, | 316 { XD_LISP_OBJECT, offsetof (Lisp_Face, shrink) }, |
317 { XD_LISP_OBJECT, offsetof (Lisp_Face, plist) }, | 317 { XD_LISP_OBJECT, offsetof (Lisp_Face, plist) }, |
318 { XD_LISP_OBJECT, offsetof (Lisp_Face, charsets_warned_about) }, | 318 { XD_LISP_OBJECT, offsetof (Lisp_Face, charsets_warned_about) }, |
319 { XD_END } | 319 { XD_END } |
320 }; | 320 }; |
321 | 321 |
405 f->strikethru = Qnil; | 405 f->strikethru = Qnil; |
406 f->highlight = Qnil; | 406 f->highlight = Qnil; |
407 f->dim = Qnil; | 407 f->dim = Qnil; |
408 f->blinking = Qnil; | 408 f->blinking = Qnil; |
409 f->reverse = Qnil; | 409 f->reverse = Qnil; |
410 f->flush = Qnil; | 410 f->shrink = Qnil; |
411 f->plist = Qnil; | 411 f->plist = Qnil; |
412 f->charsets_warned_about = Qnil; | 412 f->charsets_warned_about = Qnil; |
413 } | 413 } |
414 | 414 |
415 static Lisp_Face * | 415 static Lisp_Face * |
561 EQ (fcl->property, Qstrikethru) || | 561 EQ (fcl->property, Qstrikethru) || |
562 EQ (fcl->property, Qhighlight) || | 562 EQ (fcl->property, Qhighlight) || |
563 EQ (fcl->property, Qdim) || | 563 EQ (fcl->property, Qdim) || |
564 EQ (fcl->property, Qblinking) || | 564 EQ (fcl->property, Qblinking) || |
565 EQ (fcl->property, Qreverse) || | 565 EQ (fcl->property, Qreverse) || |
566 EQ (fcl->property, Qflush)) | 566 EQ (fcl->property, Qshrink)) |
567 { | 567 { |
568 update_inheritance_mapper_internal (contents, fcl->face, Qunderline); | 568 update_inheritance_mapper_internal (contents, fcl->face, Qunderline); |
569 update_inheritance_mapper_internal (contents, fcl->face, Qstrikethru); | 569 update_inheritance_mapper_internal (contents, fcl->face, Qstrikethru); |
570 update_inheritance_mapper_internal (contents, fcl->face, Qhighlight); | 570 update_inheritance_mapper_internal (contents, fcl->face, Qhighlight); |
571 update_inheritance_mapper_internal (contents, fcl->face, Qdim); | 571 update_inheritance_mapper_internal (contents, fcl->face, Qdim); |
572 update_inheritance_mapper_internal (contents, fcl->face, Qblinking); | 572 update_inheritance_mapper_internal (contents, fcl->face, Qblinking); |
573 update_inheritance_mapper_internal (contents, fcl->face, Qreverse); | 573 update_inheritance_mapper_internal (contents, fcl->face, Qreverse); |
574 update_inheritance_mapper_internal (contents, fcl->face, Qflush); | 574 update_inheritance_mapper_internal (contents, fcl->face, Qshrink); |
575 } | 575 } |
576 return 0; | 576 return 0; |
577 } | 577 } |
578 | 578 |
579 static void | 579 static void |
877 set_face_boolean_attached_to (f->dim, face, Qdim); | 877 set_face_boolean_attached_to (f->dim, face, Qdim); |
878 f->blinking = Fmake_specifier (Qface_boolean); | 878 f->blinking = Fmake_specifier (Qface_boolean); |
879 set_face_boolean_attached_to (f->blinking, face, Qblinking); | 879 set_face_boolean_attached_to (f->blinking, face, Qblinking); |
880 f->reverse = Fmake_specifier (Qface_boolean); | 880 f->reverse = Fmake_specifier (Qface_boolean); |
881 set_face_boolean_attached_to (f->reverse, face, Qreverse); | 881 set_face_boolean_attached_to (f->reverse, face, Qreverse); |
882 f->flush = Fmake_specifier (Qface_boolean); | 882 f->shrink = Fmake_specifier (Qface_boolean); |
883 set_face_boolean_attached_to (f->flush, face, Qflush); | 883 set_face_boolean_attached_to (f->shrink, face, Qshrink); |
884 if (!NILP (Vdefault_face)) | 884 if (!NILP (Vdefault_face)) |
885 { | 885 { |
886 /* If the default face has already been created, set it as | 886 /* If the default face has already been created, set it as |
887 the default fallback specifier for all the specifiers we | 887 the default fallback specifier for all the specifiers we |
888 just created. This implements the standard "all faces | 888 just created. This implements the standard "all faces |
911 Fget (Vdefault_face, Qdim, Qunbound)); | 911 Fget (Vdefault_face, Qdim, Qunbound)); |
912 set_specifier_fallback (f->blinking, | 912 set_specifier_fallback (f->blinking, |
913 Fget (Vdefault_face, Qblinking, Qunbound)); | 913 Fget (Vdefault_face, Qblinking, Qunbound)); |
914 set_specifier_fallback (f->reverse, | 914 set_specifier_fallback (f->reverse, |
915 Fget (Vdefault_face, Qreverse, Qunbound)); | 915 Fget (Vdefault_face, Qreverse, Qunbound)); |
916 set_specifier_fallback (f->flush, | 916 set_specifier_fallback (f->shrink, |
917 Fget (Vdefault_face, Qflush, Qunbound)); | 917 Fget (Vdefault_face, Qshrink, Qunbound)); |
918 } | 918 } |
919 | 919 |
920 /* Add the face to the appropriate list. */ | 920 /* Add the face to the appropriate list. */ |
921 if (NILP (temporary)) | 921 if (NILP (temporary)) |
922 Fputhash (name, face, Vpermanent_faces_cache); | 922 Fputhash (name, face, Vpermanent_faces_cache); |
1483 FROB (underline); | 1483 FROB (underline); |
1484 FROB (strikethru); | 1484 FROB (strikethru); |
1485 FROB (highlight); | 1485 FROB (highlight); |
1486 FROB (dim); | 1486 FROB (dim); |
1487 FROB (reverse); | 1487 FROB (reverse); |
1488 FROB (flush); | 1488 FROB (shrink); |
1489 FROB (blinking); | 1489 FROB (blinking); |
1490 #undef FROB | 1490 #undef FROB |
1491 } | 1491 } |
1492 | 1492 |
1493 cachel->updated = 1; | 1493 cachel->updated = 1; |
1523 FROB (underline); | 1523 FROB (underline); |
1524 FROB (strikethru); | 1524 FROB (strikethru); |
1525 FROB (highlight); | 1525 FROB (highlight); |
1526 FROB (dim); | 1526 FROB (dim); |
1527 FROB (reverse); | 1527 FROB (reverse); |
1528 FROB (flush); | 1528 FROB (shrink); |
1529 FROB (blinking); | 1529 FROB (blinking); |
1530 | 1530 |
1531 for (offs = 0; offs < NUM_LEADING_BYTES; ++offs) | 1531 for (offs = 0; offs < NUM_LEADING_BYTES; ++offs) |
1532 { | 1532 { |
1533 if (!(bit_vector_bit(FACE_CACHEL_FONT_SPECIFIED(cachel), offs)) | 1533 if (!(bit_vector_bit(FACE_CACHEL_FONT_SPECIFIED(cachel), offs)) |
2037 COPY_PROPERTY (strikethru); | 2037 COPY_PROPERTY (strikethru); |
2038 COPY_PROPERTY (highlight); | 2038 COPY_PROPERTY (highlight); |
2039 COPY_PROPERTY (dim); | 2039 COPY_PROPERTY (dim); |
2040 COPY_PROPERTY (blinking); | 2040 COPY_PROPERTY (blinking); |
2041 COPY_PROPERTY (reverse); | 2041 COPY_PROPERTY (reverse); |
2042 COPY_PROPERTY (flush); | 2042 COPY_PROPERTY (shrink); |
2043 #undef COPY_PROPERTY | 2043 #undef COPY_PROPERTY |
2044 /* #### should it copy the individual specifiers, if they exist? */ | 2044 /* #### should it copy the individual specifiers, if they exist? */ |
2045 fnew->plist = Fcopy_sequence (fold->plist); | 2045 fnew->plist = Fcopy_sequence (fold->plist); |
2046 | 2046 |
2047 UNGCPRO; | 2047 UNGCPRO; |
2177 DEFSYMBOL (Qunderline); | 2177 DEFSYMBOL (Qunderline); |
2178 DEFSYMBOL (Qstrikethru); | 2178 DEFSYMBOL (Qstrikethru); |
2179 /* Qhighlight, Qreverse defined in general.c */ | 2179 /* Qhighlight, Qreverse defined in general.c */ |
2180 DEFSYMBOL (Qdim); | 2180 DEFSYMBOL (Qdim); |
2181 DEFSYMBOL (Qblinking); | 2181 DEFSYMBOL (Qblinking); |
2182 DEFSYMBOL (Qflush); | 2182 DEFSYMBOL (Qshrink); |
2183 | 2183 |
2184 DEFSYMBOL (Qface_alias); | 2184 DEFSYMBOL (Qface_alias); |
2185 DEFERROR_STANDARD (Qcyclic_face_alias, Qinvalid_state); | 2185 DEFERROR_STANDARD (Qcyclic_face_alias, Qinvalid_state); |
2186 | 2186 |
2187 DEFSYMBOL (Qinit_face_from_resources); | 2187 DEFSYMBOL (Qinit_face_from_resources); |
2244 #endif | 2244 #endif |
2245 | 2245 |
2246 Vbuilt_in_face_specifiers = | 2246 Vbuilt_in_face_specifiers = |
2247 listu (Qforeground, Qbackground, Qfont, Qdisplay_table, Qbackground_pixmap, | 2247 listu (Qforeground, Qbackground, Qfont, Qdisplay_table, Qbackground_pixmap, |
2248 Qbackground_placement, Qunderline, Qstrikethru, Qhighlight, Qdim, | 2248 Qbackground_placement, Qunderline, Qstrikethru, Qhighlight, Qdim, |
2249 Qblinking, Qreverse, Qflush, Qunbound); | 2249 Qblinking, Qreverse, Qshrink, Qunbound); |
2250 staticpro (&Vbuilt_in_face_specifiers); | 2250 staticpro (&Vbuilt_in_face_specifiers); |
2251 } | 2251 } |
2252 | 2252 |
2253 void | 2253 void |
2254 complex_vars_of_faces (void) | 2254 complex_vars_of_faces (void) |
2500 list1 (Fcons (Qnil, Qnil))); | 2500 list1 (Fcons (Qnil, Qnil))); |
2501 set_specifier_fallback (Fget (Vdefault_face, Qblinking, Qnil), | 2501 set_specifier_fallback (Fget (Vdefault_face, Qblinking, Qnil), |
2502 list1 (Fcons (Qnil, Qnil))); | 2502 list1 (Fcons (Qnil, Qnil))); |
2503 set_specifier_fallback (Fget (Vdefault_face, Qreverse, Qnil), | 2503 set_specifier_fallback (Fget (Vdefault_face, Qreverse, Qnil), |
2504 list1 (Fcons (Qnil, Qnil))); | 2504 list1 (Fcons (Qnil, Qnil))); |
2505 set_specifier_fallback (Fget (Vdefault_face, Qflush, Qnil), | 2505 set_specifier_fallback (Fget (Vdefault_face, Qshrink, Qnil), |
2506 list1 (Fcons (Qnil, Qnil))); | 2506 list1 (Fcons (Qnil, Qnil))); |
2507 | 2507 |
2508 /* gui-element is the parent face of all gui elements such as | 2508 /* gui-element is the parent face of all gui elements such as |
2509 modeline, vertical divider and toolbar. */ | 2509 modeline, vertical divider and toolbar. */ |
2510 Vgui_element_face = Fmake_face (Qgui_element, | 2510 Vgui_element_face = Fmake_face (Qgui_element, |