diff src/faces.c @ 5617:b0d712bbc2a6

The "flush" face property. -------------------- ChangeLog entries follow: -------------------- src/ChangeLog addition: 2011-12-23 Didier Verna <didier@xemacs.org> * faces.h (struct Lisp_Face): New 'flush slot. * faces.h (struct face_cachel): New 'flush and 'flush_specified flags. * faces.h (WINDOW_FACE_CACHEL_FLUSH_P): * faces.h (FACE_FLUSH_P): New macros. * faces.c: Declare Qflush. * lisp.h: Externalize it. * faces.c (syms_of_faces): Define it. * faces.c (vars_of_faces): Update built-in face specifiers. * faces.c (complex_vars_of_faces): Update specifier fallbacks. * 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): * fontcolor.c (face_boolean_validate): Handle the flush property. * redisplay.h (struct display_line): Rename 'default_findex slot to clearer name 'clear_findex. * redisplay.h (DISPLAY_LINE_INIT): Update accordingly. * redisplay-output.c (compare_display_blocks): * redisplay-output.c (output_display_line): * redisplay-output.c (redisplay_output_window): * redisplay.c (regenerate_window_extents_only_changed): * redisplay.c (regenerate_window_incrementally): Update the comparison tests between the current and desired display lines to cope for different 'clear_findex values. * redisplay.c (create_text_block): Initialize the display line's 'clear_findex slot to DEFAULT_INDEX. Record a new 'clear_findex value when we encounter a newline character displayed in a flushed face. * redisplay.c (create_string_text_block): Record a new 'clear_findex value when we encounter a newline character displayed in a flushed face. lisp/ChangeLog addition: 2011-12-23 Didier Verna <didier@xemacs.org> * cl-macs.el (face-flush-p): New defsetf. * faces.el (set-face-property): Document the flush property. * faces.el (face-flush-p): New function. * faces.el (set-face-flush-p): New function. * faces.el (face-equal): * cus-face.el (custom-face-attributes): * x-faces.el (x-init-face-from-resources): * x-faces.el (make-face-x-resource-internal): Handle the flush property.
author Didier Verna <didier@xemacs.org>
date Fri, 23 Dec 2011 10:56:16 +0100
parents 248176c74e6b
children 75ad4969a16d
line wrap: on
line diff
--- a/src/faces.c	Thu Dec 22 15:02:02 2011 +0000
+++ b/src/faces.c	Fri Dec 23 10:56:16 2011 +0100
@@ -42,7 +42,7 @@
 Lisp_Object Qfacep;
 Lisp_Object Qforeground, Qbackground, Qdisplay_table;
 Lisp_Object Qbackground_pixmap, Qbackground_placement, Qunderline, Qdim;
-Lisp_Object Qblinking, Qstrikethru, Q_name;
+Lisp_Object Qblinking, Qstrikethru, Qflush, Q_name;
 
 Lisp_Object Qinit_face_from_resources;
 Lisp_Object Qinit_frame_faces;
@@ -117,6 +117,7 @@
   mark_object (face->dim);
   mark_object (face->blinking);
   mark_object (face->reverse);
+  mark_object (face->flush);
 
   mark_object (face->charsets_warned_about);
 
@@ -171,6 +172,7 @@
      internal_equal (f1->dim,		     f2->dim,		    depth) &&
      internal_equal (f1->blinking,	     f2->blinking,	    depth) &&
      internal_equal (f1->reverse,	     f2->reverse,	    depth) &&
+     internal_equal (f1->flush,	             f2->flush,	            depth) &&
 
      ! plists_differ (f1->plist, f2->plist, 0, 0, depth + 1, 0));
 }
@@ -207,6 +209,7 @@
      EQ (prop, Qdim)		      ? f->dim                  :
      EQ (prop, Qblinking)	      ? f->blinking             :
      EQ (prop, Qreverse)	      ? f->reverse              :
+     EQ (prop, Qflush)	              ? f->flush                :
      EQ (prop, Qdoc_string)	      ? f->doc_string           :
      external_plist_get (&f->plist, prop, 0, ERROR_ME));
 }
@@ -227,7 +230,8 @@
       EQ (prop, Qhighlight)            ||
       EQ (prop, Qdim)                  ||
       EQ (prop, Qblinking)             ||
-      EQ (prop, Qreverse))
+      EQ (prop, Qreverse)              ||
+      EQ (prop, Qflush))
     return 0;
 
   if (EQ (prop, Qdoc_string))
@@ -258,7 +262,8 @@
       EQ (prop, Qhighlight)            ||
       EQ (prop, Qdim)                  ||
       EQ (prop, Qblinking)             ||
-      EQ (prop, Qreverse))
+      EQ (prop, Qreverse)              ||
+      EQ (prop, Qflush))
     return -1;
 
   if (EQ (prop, Qdoc_string))
@@ -276,6 +281,7 @@
   Lisp_Face *face = XFACE (obj);
   Lisp_Object result = face->plist;
 
+  result = cons3 (Qflush,	         face->flush,	               result);
   result = cons3 (Qreverse,	         face->reverse,	               result);
   result = cons3 (Qblinking,	         face->blinking,               result);
   result = cons3 (Qdim,		         face->dim,	               result);
@@ -307,6 +313,7 @@
   { XD_LISP_OBJECT, offsetof (Lisp_Face, dim) },
   { XD_LISP_OBJECT, offsetof (Lisp_Face, blinking) },
   { XD_LISP_OBJECT, offsetof (Lisp_Face, reverse) },
+  { XD_LISP_OBJECT, offsetof (Lisp_Face, flush) },
   { XD_LISP_OBJECT, offsetof (Lisp_Face, plist) },
   { XD_LISP_OBJECT, offsetof (Lisp_Face, charsets_warned_about) },
   { XD_END }
@@ -400,6 +407,7 @@
   f->dim = Qnil;
   f->blinking = Qnil;
   f->reverse = Qnil;
+  f->flush = Qnil;
   f->plist = Qnil;
   f->charsets_warned_about = Qnil;
 }
@@ -554,7 +562,8 @@
 	   EQ (fcl->property, Qhighlight)  ||
 	   EQ (fcl->property, Qdim)        ||
 	   EQ (fcl->property, Qblinking)   ||
-	   EQ (fcl->property, Qreverse))
+	   EQ (fcl->property, Qreverse)    ||
+	   EQ (fcl->property, Qflush))
     {
       update_inheritance_mapper_internal (contents, fcl->face, Qunderline);
       update_inheritance_mapper_internal (contents, fcl->face, Qstrikethru);
@@ -562,6 +571,7 @@
       update_inheritance_mapper_internal (contents, fcl->face, Qdim);
       update_inheritance_mapper_internal (contents, fcl->face, Qblinking);
       update_inheritance_mapper_internal (contents, fcl->face, Qreverse);
+      update_inheritance_mapper_internal (contents, fcl->face, Qflush);
     }
   return 0;
 }
@@ -869,6 +879,8 @@
   set_face_boolean_attached_to (f->blinking, face, Qblinking);
   f->reverse = Fmake_specifier (Qface_boolean);
   set_face_boolean_attached_to (f->reverse, face, Qreverse);
+  f->flush = Fmake_specifier (Qface_boolean);
+  set_face_boolean_attached_to (f->flush, face, Qflush);
   if (!NILP (Vdefault_face))
     {
       /* If the default face has already been created, set it as
@@ -901,6 +913,8 @@
 			     Fget (Vdefault_face, Qblinking, Qunbound));
       set_specifier_fallback (f->reverse,
 			     Fget (Vdefault_face, Qreverse, Qunbound));
+      set_specifier_fallback (f->flush,
+			     Fget (Vdefault_face, Qflush, Qunbound));
     }
 
   /* Add the face to the appropriate list. */
@@ -1471,6 +1485,7 @@
       FROB (highlight);
       FROB (dim);
       FROB (reverse);
+      FROB (flush);
       FROB (blinking);
 #undef FROB
     }
@@ -1510,6 +1525,7 @@
   FROB (highlight);
   FROB (dim);
   FROB (reverse);
+  FROB (flush);
   FROB (blinking);
 
   for (offs = 0; offs < NUM_LEADING_BYTES; ++offs)
@@ -2023,6 +2039,7 @@
   COPY_PROPERTY (dim);
   COPY_PROPERTY (blinking);
   COPY_PROPERTY (reverse);
+  COPY_PROPERTY (flush);
 #undef COPY_PROPERTY
   /* #### should it copy the individual specifiers, if they exist? */
   fnew->plist = Fcopy_sequence (fold->plist);
@@ -2162,6 +2179,7 @@
   /* Qhighlight, Qreverse defined in general.c */
   DEFSYMBOL (Qdim);
   DEFSYMBOL (Qblinking);
+  DEFSYMBOL (Qflush);
 
   DEFSYMBOL (Qface_alias);
   DEFERROR_STANDARD (Qcyclic_face_alias, Qinvalid_state);
@@ -2228,7 +2246,7 @@
   Vbuilt_in_face_specifiers =
     listu (Qforeground, Qbackground, Qfont, Qdisplay_table, Qbackground_pixmap,
 	   Qbackground_placement, Qunderline, Qstrikethru, Qhighlight, Qdim,
-	   Qblinking, Qreverse, Qunbound);
+	   Qblinking, Qreverse, Qflush, Qunbound);
   staticpro (&Vbuilt_in_face_specifiers);
 }
 
@@ -2484,6 +2502,8 @@
 			 list1 (Fcons (Qnil, Qnil)));
   set_specifier_fallback (Fget (Vdefault_face, Qreverse, Qnil),
 			 list1 (Fcons (Qnil, Qnil)));
+  set_specifier_fallback (Fget (Vdefault_face, Qflush, Qnil),
+			 list1 (Fcons (Qnil, Qnil)));
 
   /* gui-element is the parent face of all gui elements such as
      modeline, vertical divider and toolbar. */