[COMMIT] New "foreback" face property
12 years, 12 months
Didier Verna
NOTE: This patch has been committed.
... and here's another new face property that will most likely never
be used, but still fixes one particular problem. See the following blog
entry for an explanation:
http://www.didierverna.com/sciblog/index.php?post/2011/12/27/XEmacs-now-h...
As usual, the property name is open for suggestions ;-)
lisp/ChangeLog addition:
2011-12-27 Didier Verna <didier(a)xemacs.org>
* cl-macs.el (face-foreback): New defsetf.
* faces.el (set-face-property): Document the foreback property.
* faces.el (face-foreback):
* faces.el (face-foreback-instance):
* faces.el (face-foreback-name):
* faces.el (set-face-foreback): New functions.
* faces.el (face-equal):
* faces.el (init-other-random-faces):
* cus-face.el (custom-face-attributes):
* x-faces.el (x-init-face-from-resources): Handle the foreback
property.
src/ChangeLog addition:
2011-12-27 Didier Verna <didier(a)xemacs.org>
* faces.h (struct Lisp_Face): New 'foreback slot.
* faces.h (struct face_cachel): New 'foreback and
'foreback_specified slots.
* faces.h (WINDOW_FACE_CACHEL_FOREBACK):
* faces.h (FACE_FOREBACK): New macros.
* faces.c: Declare Qforeback.
* 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 (mark_face_cachels):
* faces.c (update_face_cachel_data):
* faces.c (merge_face_cachel_data):
* faces.c (reset_face_cachel):
* faces.c (face_property_was_changed):
* faces.c (Fcopy_face):
* fontcolor.c (face_color_validate): Handle the foreback property.
* redisplay-msw.c (mswindows_output_blank):
* redisplay-msw.c (mswindows_output_string):
* redisplay-output.c (redisplay_clear_region):
* redisplay-xlike-inc.c (XLIKE_output_string):
* redisplay-xlike-inc.c (XLIKE_output_blank): Use the face's
foreback color instead of the foreground one for drawing a
background bitmap.
XEmacs 21.5 source patch:
Diff command: hg diff --git --show-function
Files affected: lisp/cl-macs.el lisp/cus-face.el lisp/faces.el lisp/x-faces.el src/faces.c src/faces.h src/fontcolor.c src/lisp.h src/redisplay-msw.c src/redisplay-output.c src/redisplay-xlike-inc.c
diff --git a/lisp/cl-macs.el b/lisp/cl-macs.el
--- a/lisp/cl-macs.el
+++ b/lisp/cl-macs.el
@@ -2111,13 +2111,14 @@ Example: (defsetf nth (n x) (v) (list 's
(defsetf extent-start-position (ext) (store)
`(progn (set-extent-endpoints ,ext ,store (extent-end-position ,ext))
,store))
+(defsetf face-foreground (f &optional s) (x) (list 'set-face-foreground f x s))
+(defsetf face-foreback (f &optional s) (x) (list 'set-face-foreback f x s))
(defsetf face-background (f &optional s) (x) (list 'set-face-background f x s))
(defsetf face-background-pixmap (f &optional s) (x)
(list 'set-face-background-pixmap f x s))
(defsetf face-background-placement (f &optional s) (x)
(list 'set-face-background-placement f x s))
(defsetf face-font (f &optional s) (x) (list 'set-face-font f x s))
-(defsetf face-foreground (f &optional s) (x) (list 'set-face-foreground f x s))
(defsetf face-underline-p (f &optional s) (x)
(list 'set-face-underline-p f x s))
(defsetf face-shrink-p (f &optional s) (x)
diff --git a/lisp/cus-face.el b/lisp/cus-face.el
--- a/lisp/cus-face.el
+++ b/lisp/cus-face.el
@@ -83,6 +83,10 @@
:value ""
:help-echo "Set foreground color.")
set-face-foreground face-foreground-name)
+ (:foreback (color :tag "Foreback"
+ :value ""
+ :help-echo "Set foreback color.")
+ set-face-foreback face-foreback-name)
(:background (color :tag "Background"
:value ""
:help-echo "Set background color.")
diff --git a/lisp/faces.el b/lisp/faces.el
--- a/lisp/faces.el
+++ b/lisp/faces.el
@@ -322,6 +322,11 @@ The following symbols have predefined me
foreground The foreground color of the face.
For valid instantiators, see `make-color-specifier'.
+ foreback The foreground color of the face's background pixmap,
+ when the pixmap is a bitmap.
+ Only used by faces on X and MS Windows devices.
+ For valid instantiators, see `make-color-specifier'.
+
background The background color of the face.
For valid instantiators, see `make-color-specifier'.
@@ -583,6 +588,72 @@ See `set-face-property' for more informa
(interactive (face-interactive "foreground"))
(set-face-property face 'foreground color locale tag-set how-to-add))
+(defun face-foreback (face &optional locale tag-set exact-p)
+ "Return the foreback spec of FACE in LOCALE, or nil if it is unspecified.
+
+NOTE: This returns a locale-specific specification, not any sort of value
+corresponding to the actual foreback being used. If you want to know the
+actual foreback color used in a particular domain, use
+`face-foreback-instance', or `face-foreback-name' for its name
+\(i.e. the instantiator used to create it).
+
+FACE may be either a face object or a symbol representing a face.
+
+LOCALE may be a locale (the instantiators for that particular locale
+ will be returned), a locale type (the specifications for all locales
+ of that type will be returned), `all' (all specifications will be
+ returned), or nil (the actual specifier object will be returned).
+
+See `face-property' for more information."
+ (face-property face 'foreback locale tag-set exact-p))
+
+(defun face-foreback-instance (face &optional domain default no-fallback)
+ "Return the instance of FACE's foreback in DOMAIN.
+
+Return value will be a color instance object; query its properties using
+`color-instance-name' or `color-instance-rgb-properties'.
+
+FACE may be either a face object or a symbol representing a face.
+
+Normally DOMAIN will be a window or nil (meaning the selected window),
+ and an instance object describing how the foreback appears in that
+ particular window and buffer will be returned.
+
+See `face-property-instance' for more information."
+ (face-property-instance face 'foreback domain default no-fallback))
+
+(defun face-foreback-name (face &optional domain default no-fallback)
+ "Return the name of FACE's foreback color in DOMAIN.
+
+FACE may be either a face object or a symbol representing a face.
+
+Normally DOMAIN will be a window or nil (meaning the selected window),
+ and an instance object describing how the foreback appears in that
+ particular window and buffer will be returned.
+
+See `face-property-instance' for more information."
+ (color-instance-name (face-foreback-instance
+ face domain default no-fallback)))
+
+(defun set-face-foreback (face color &optional locale tag-set how-to-add)
+ "Change the foreback color of FACE to COLOR in LOCALE.
+
+FACE may be either a face object or a symbol representing a face.
+
+COLOR should be an instantiator (see `make-color-specifier'), a list of
+ instantiators, an alist of specifications (each mapping a locale to
+ an instantiator list), or a color specifier object.
+
+If COLOR is an alist, LOCALE must be omitted. If COLOR is a
+ specifier object, LOCALE can be a locale, a locale type, `all',
+ or nil; see `copy-specifier' for its semantics. Otherwise LOCALE
+ specifies the locale under which the specified instantiator(s)
+ will be added, and defaults to `global'.
+
+See `set-face-property' for more information."
+ (interactive (face-interactive "foreback"))
+ (set-face-property face 'foreback color locale tag-set how-to-add))
+
(defun face-background (face &optional locale tag-set exact-p)
"Return the background color of FACE in LOCALE, or nil if it is unspecified.
@@ -935,9 +1006,11 @@ See `face-property-instance' for the sem
(if (not (valid-specifier-domain-p domain))
(error "Invalid specifier domain"))
(let ((device (dfw-device domain))
- (common-props '(foreground background font display-table underline
- dim inherit shrink))
- (win-props '(background-pixmap background-placement strikethru))
+ (common-props '(foreground background
+ font display-table underline
+ dim inherit shrink))
+ (win-props '(foreback background-pixmap background-placement
+ strikethru))
(tty-props '(highlight blinking reverse)))
;; First check the properties which are used in common between the
@@ -2005,7 +2078,7 @@ you want to add code to do stuff like th
;; element faces. So take the modeline face information from its
;; fallbacks, themselves ultimately set up in faces.c:
(loop
- for face-property in '(foreground background
+ for face-property in '(foreground foreback background
background-pixmap background-placement)
do (when (and (setq face-property (face-property 'modeline face-property))
(null (specifier-instance face-property device nil t))
diff --git a/lisp/x-faces.el b/lisp/x-faces.el
--- a/lisp/x-faces.el
+++ b/lisp/x-faces.el
@@ -698,6 +698,10 @@ Otherwise, it returns the next larger ve
(concat name ".attributeForeground")
"Face.AttributeForeground"
'string locale))
+ (fb (x-get-resource-and-maybe-bogosity-check
+ (concat name ".attributeForeback")
+ "Face.AttributeForeback"
+ 'string locale))
(bg (x-get-resource-and-maybe-bogosity-check
(concat name ".attributeBackground")
"Face.AttributeBackground"
@@ -815,6 +819,13 @@ Otherwise, it returns the next larger ve
x-tag-set)
(remove-specifier (face-foreground face) locale x-tag-set nil))
(set-face-foreground face fg locale our-tag-set append))
+ (when fb
+ (if device-class
+ (remove-specifier-specs-matching-tag-set-cdrs (face-foreback face)
+ locale
+ x-tag-set)
+ (remove-specifier (face-foreback face) locale x-tag-set nil))
+ (set-face-foreback face fb locale our-tag-set append))
(when bg
(if device-class
(remove-specifier-specs-matching-tag-set-cdrs (face-background face)
diff --git a/src/faces.c b/src/faces.c
--- a/src/faces.c
+++ b/src/faces.c
@@ -40,7 +40,7 @@ along with XEmacs. If not, see <http://
#include "window.h"
Lisp_Object Qfacep;
-Lisp_Object Qforeground, Qbackground, Qdisplay_table;
+Lisp_Object Qforeground, Qforeback, Qbackground, Qdisplay_table;
Lisp_Object Qbackground_pixmap, Qbackground_placement, Qunderline, Qdim;
Lisp_Object Qblinking, Qstrikethru, Qshrink, Q_name;
@@ -106,6 +106,7 @@ mark_face (Lisp_Object obj)
mark_object (face->doc_string);
mark_object (face->foreground);
+ mark_object (face->foreback);
mark_object (face->background);
mark_object (face->font);
mark_object (face->display_table);
@@ -159,6 +160,7 @@ face_equal (Lisp_Object obj1, Lisp_Objec
return
(internal_equal (f1->foreground, f2->foreground, depth) &&
+ internal_equal (f1->foreback, f2->foreback, depth) &&
internal_equal (f1->background, f2->background, depth) &&
internal_equal (f1->font, f2->font, depth) &&
internal_equal (f1->display_table, f2->display_table, depth) &&
@@ -198,6 +200,7 @@ face_getprop (Lisp_Object obj, Lisp_Obje
return
(EQ (prop, Qforeground) ? f->foreground :
+ EQ (prop, Qforeback) ? f->foreback :
EQ (prop, Qbackground) ? f->background :
EQ (prop, Qfont) ? f->font :
EQ (prop, Qdisplay_table) ? f->display_table :
@@ -220,6 +223,7 @@ face_putprop (Lisp_Object obj, Lisp_Obje
Lisp_Face *f = XFACE (obj);
if (EQ (prop, Qforeground) ||
+ EQ (prop, Qforeback) ||
EQ (prop, Qbackground) ||
EQ (prop, Qfont) ||
EQ (prop, Qdisplay_table) ||
@@ -252,6 +256,7 @@ face_remprop (Lisp_Object obj, Lisp_Obje
Lisp_Face *f = XFACE (obj);
if (EQ (prop, Qforeground) ||
+ EQ (prop, Qforeback) ||
EQ (prop, Qbackground) ||
EQ (prop, Qfont) ||
EQ (prop, Qdisplay_table) ||
@@ -293,6 +298,7 @@ face_plist (Lisp_Object obj)
result = cons3 (Qdisplay_table, face->display_table, result);
result = cons3 (Qfont, face->font, result);
result = cons3 (Qbackground, face->background, result);
+ result = cons3 (Qforeback, face->foreback, result);
result = cons3 (Qforeground, face->foreground, result);
return result;
@@ -302,6 +308,7 @@ static const struct memory_description f
{ XD_LISP_OBJECT, offsetof (Lisp_Face, name) },
{ XD_LISP_OBJECT, offsetof (Lisp_Face, doc_string) },
{ XD_LISP_OBJECT, offsetof (Lisp_Face, foreground) },
+ { XD_LISP_OBJECT, offsetof (Lisp_Face, foreback) },
{ XD_LISP_OBJECT, offsetof (Lisp_Face, background) },
{ XD_LISP_OBJECT, offsetof (Lisp_Face, font) },
{ XD_LISP_OBJECT, offsetof (Lisp_Face, display_table) },
@@ -396,6 +403,7 @@ reset_face (Lisp_Face *f)
f->doc_string = Qnil;
f->dirty = 0;
f->foreground = Qnil;
+ f->foreback = Qnil;
f->background = Qnil;
f->font = Qnil;
f->display_table = Qnil;
@@ -552,9 +560,11 @@ update_face_inheritance_mapper (const vo
update_inheritance_mapper_internal (contents, fcl->face, Qfont);
}
else if (EQ (fcl->property, Qforeground) ||
+ EQ (fcl->property, Qforeback) ||
EQ (fcl->property, Qbackground))
{
update_inheritance_mapper_internal (contents, fcl->face, Qforeground);
+ update_inheritance_mapper_internal (contents, fcl->face, Qforeback);
update_inheritance_mapper_internal (contents, fcl->face, Qbackground);
}
else if (EQ (fcl->property, Qunderline) ||
@@ -858,6 +868,8 @@ If TEMPORARY is non-nil, this face will
f->doc_string = doc_string;
f->foreground = Fmake_specifier (Qcolor);
set_color_attached_to (f->foreground, face, Qforeground);
+ f->foreback = Fmake_specifier (Qcolor);
+ set_color_attached_to (f->foreback, face, Qforeback);
f->background = Fmake_specifier (Qcolor);
set_color_attached_to (f->background, face, Qbackground);
f->font = Fmake_specifier (Qfont);
@@ -888,33 +900,35 @@ If TEMPORARY is non-nil, this face will
just created. This implements the standard "all faces
inherit from default" behavior. */
set_specifier_fallback (f->foreground,
- Fget (Vdefault_face, Qforeground, Qunbound));
+ Fget (Vdefault_face, Qforeground, Qunbound));
+ set_specifier_fallback (f->foreback,
+ Fget (Vdefault_face, Qforeback, Qunbound));
set_specifier_fallback (f->background,
- Fget (Vdefault_face, Qbackground, Qunbound));
+ Fget (Vdefault_face, Qbackground, Qunbound));
set_specifier_fallback (f->font,
- Fget (Vdefault_face, Qfont, Qunbound));
+ Fget (Vdefault_face, Qfont, Qunbound));
set_specifier_fallback (f->background_pixmap,
- Fget (Vdefault_face, Qbackground_pixmap,
- Qunbound));
+ Fget (Vdefault_face, Qbackground_pixmap,
+ Qunbound));
set_specifier_fallback (f->background_placement,
Fget (Vdefault_face, Qbackground_placement,
Qunbound));
set_specifier_fallback (f->display_table,
- Fget (Vdefault_face, Qdisplay_table, Qunbound));
+ Fget (Vdefault_face, Qdisplay_table, Qunbound));
set_specifier_fallback (f->underline,
- Fget (Vdefault_face, Qunderline, Qunbound));
+ Fget (Vdefault_face, Qunderline, Qunbound));
set_specifier_fallback (f->strikethru,
- Fget (Vdefault_face, Qstrikethru, Qunbound));
+ Fget (Vdefault_face, Qstrikethru, Qunbound));
set_specifier_fallback (f->highlight,
- Fget (Vdefault_face, Qhighlight, Qunbound));
+ Fget (Vdefault_face, Qhighlight, Qunbound));
set_specifier_fallback (f->dim,
- Fget (Vdefault_face, Qdim, Qunbound));
+ Fget (Vdefault_face, Qdim, Qunbound));
set_specifier_fallback (f->blinking,
- Fget (Vdefault_face, Qblinking, Qunbound));
+ Fget (Vdefault_face, Qblinking, Qunbound));
set_specifier_fallback (f->reverse,
- Fget (Vdefault_face, Qreverse, Qunbound));
+ Fget (Vdefault_face, Qreverse, Qunbound));
set_specifier_fallback (f->shrink,
- Fget (Vdefault_face, Qshrink, Qunbound));
+ Fget (Vdefault_face, Qshrink, Qunbound));
}
/* Add the face to the appropriate list. */
@@ -1092,6 +1106,7 @@ mark_face_cachels (face_cachel_dynarr *e
}
mark_object (cachel->face);
mark_object (cachel->foreground);
+ mark_object (cachel->foreback);
mark_object (cachel->background);
mark_object (cachel->display_table);
mark_object (cachel->background_pixmap);
@@ -1406,6 +1421,7 @@ update_face_cachel_data (struct face_cac
we always set it since it is the ultimate fallback. */
FROB (foreground);
+ FROB (foreback);
FROB (background);
FROB (display_table);
@@ -1516,6 +1532,7 @@ merge_face_cachel_data (struct window *w
} while (0)
FROB (foreground);
+ FROB (foreback);
FROB (background);
FROB (display_table);
FROB (background_pixmap);
@@ -1562,6 +1579,7 @@ reset_face_cachel (struct face_cachel *c
cachel->nfaces = 0;
cachel->merged_faces = 0;
cachel->foreground = Qunbound;
+ cachel->foreback = Qunbound;
cachel->background = Qunbound;
{
int i;
@@ -1937,8 +1955,8 @@ face_property_was_changed (Lisp_Object f
/* If the locale could affect the frame value, then call
update_EmacsFrames just in case. */
if (default_face &&
- (EQ (property, Qforeground) ||
- EQ (property, Qbackground) ||
+ (EQ (property, Qforeground) ||
+ EQ (property, Qbackground) ||
EQ (property, Qfont)))
update_EmacsFrames (locale, property);
@@ -2028,6 +2046,7 @@ LOCALE, TAG-SET, EXACT-P, and HOW-TO-ADD
locale, tag_set, exact_p, how_to_add);
COPY_PROPERTY (foreground);
+ COPY_PROPERTY (foreback);
COPY_PROPERTY (background);
COPY_PROPERTY (font);
COPY_PROPERTY (display_table);
@@ -2169,6 +2188,7 @@ syms_of_faces (void)
DEFSYMBOL (Qfacep);
DEFSYMBOL (Qforeground);
+ DEFSYMBOL (Qforeback);
DEFSYMBOL (Qbackground);
/* Qfont defined in general.c */
DEFSYMBOL (Qdisplay_table);
@@ -2244,8 +2264,9 @@ If non-zero, display debug information a
#endif
Vbuilt_in_face_specifiers =
- listu (Qforeground, Qbackground, Qfont, Qdisplay_table, Qbackground_pixmap,
- Qbackground_placement, Qunderline, Qstrikethru, Qhighlight, Qdim,
+ listu (Qforeground, Qforeback, Qbackground,
+ Qfont, Qdisplay_table, Qbackground_pixmap, Qbackground_placement,
+ Qunderline, Qstrikethru, Qhighlight, Qdim,
Qblinking, Qreverse, Qshrink, Qunbound);
staticpro (&Vbuilt_in_face_specifiers);
}
@@ -2264,27 +2285,33 @@ complex_vars_of_faces (void)
someone provides invalid values for the global specifications. */
{
- Lisp_Object fg_fb = Qnil, bg_fb = Qnil;
+ Lisp_Object fg_fb = Qnil, bg_fb = Qnil, fb_fb = Qnil;
#ifdef HAVE_GTK
- fg_fb = Facons (list1 (Qgtk), build_ascstring ("black"), fg_fb);
- bg_fb = Facons (list1 (Qgtk), build_ascstring ("white"), bg_fb);
+ fg_fb = Facons (list1 (Qgtk), build_ascstring ("black"), fg_fb);
+ fb_fb = Facons (list1 (Qgtk), build_ascstring ("gray90"), fb_fb);
+ bg_fb = Facons (list1 (Qgtk), build_ascstring ("white"), bg_fb);
#endif
#ifdef HAVE_X_WINDOWS
- fg_fb = Facons (list1 (Qx), build_ascstring ("black"), fg_fb);
+ fg_fb = Facons (list1 (Qx), build_ascstring ("black"), fg_fb);
+ fb_fb = Facons (list1 (Qx), build_ascstring ("gray70"), fb_fb);
bg_fb = Facons (list1 (Qx), build_ascstring ("gray80"), bg_fb);
#endif
#ifdef HAVE_TTY
fg_fb = Facons (list1 (Qtty), Fvector (0, 0), fg_fb);
+ fb_fb = Facons (list1 (Qtty), Fvector (0, 0), fb_fb);
bg_fb = Facons (list1 (Qtty), Fvector (0, 0), bg_fb);
#endif
#ifdef HAVE_MS_WINDOWS
- fg_fb = Facons (list1 (Qmsprinter), build_ascstring ("black"), fg_fb);
- bg_fb = Facons (list1 (Qmsprinter), build_ascstring ("white"), bg_fb);
- fg_fb = Facons (list1 (Qmswindows), build_ascstring ("black"), fg_fb);
- bg_fb = Facons (list1 (Qmswindows), build_ascstring ("white"), bg_fb);
+ fg_fb = Facons (list1 (Qmsprinter), build_ascstring ("black"), fg_fb);
+ fb_fb = Facons (list1 (Qmsprinter), build_ascstring ("gray90"), fb_fb);
+ bg_fb = Facons (list1 (Qmsprinter), build_ascstring ("white"), bg_fb);
+ fg_fb = Facons (list1 (Qmswindows), build_ascstring ("black"), fg_fb);
+ fb_fb = Facons (list1 (Qmswindows), build_ascstring ("gray90"), fb_fb);
+ bg_fb = Facons (list1 (Qmswindows), build_ascstring ("white"), bg_fb);
#endif
set_specifier_fallback (Fget (Vdefault_face, Qforeground, Qnil), fg_fb);
+ set_specifier_fallback (Fget (Vdefault_face, Qforeback, Qnil), fb_fb);
set_specifier_fallback (Fget (Vdefault_face, Qbackground, Qnil), bg_fb);
}
@@ -2514,7 +2541,7 @@ complex_vars_of_faces (void)
/* Provide some last-resort fallbacks for gui-element face which
mustn't default to default. */
{
- Lisp_Object fg_fb = Qnil, bg_fb = Qnil;
+ Lisp_Object fg_fb = Qnil, bg_fb = Qnil, fb_fb = Qnil;
/* #### gui-element face doesn't have a font property?
But it gets referred to later! */
@@ -2539,8 +2566,12 @@ complex_vars_of_faces (void)
fg_fb = Facons (list1 (Qmswindows), build_ascstring ("black"), fg_fb);
bg_fb = Facons (list1 (Qmswindows), build_ascstring ("Gray75"), bg_fb);
#endif
- set_specifier_fallback (Fget (Vgui_element_face, Qforeground, Qnil), fg_fb);
- set_specifier_fallback (Fget (Vgui_element_face, Qbackground, Qnil), bg_fb);
+ set_specifier_fallback (Fget (Vgui_element_face, Qforeground, Qnil),
+ fg_fb);
+ set_specifier_fallback (Fget (Vgui_element_face, Qforeback, Qnil),
+ fb_fb);
+ set_specifier_fallback (Fget (Vgui_element_face, Qbackground, Qnil),
+ bg_fb);
}
/* Now create the other faces that redisplay needs to refer to
@@ -2553,6 +2584,8 @@ complex_vars_of_faces (void)
set_specifier_fallback (Fget (Vmodeline_face, Qforeground, Qunbound),
Fget (Vgui_element_face, Qforeground, Qunbound));
+ set_specifier_fallback (Fget (Vmodeline_face, Qforeback, Qunbound),
+ Fget (Vgui_element_face, Qforeback, Qunbound));
set_specifier_fallback (Fget (Vmodeline_face, Qbackground, Qunbound),
Fget (Vgui_element_face, Qbackground, Qunbound));
set_specifier_fallback (Fget (Vmodeline_face, Qbackground_pixmap, Qnil),
@@ -2568,6 +2601,8 @@ complex_vars_of_faces (void)
Qnil);
set_specifier_fallback (Fget (Vtoolbar_face, Qforeground, Qunbound),
Fget (Vgui_element_face, Qforeground, Qunbound));
+ set_specifier_fallback (Fget (Vtoolbar_face, Qforeback, Qunbound),
+ Fget (Vgui_element_face, Qforeback, Qunbound));
set_specifier_fallback (Fget (Vtoolbar_face, Qbackground, Qunbound),
Fget (Vgui_element_face, Qbackground, Qunbound));
set_specifier_fallback (Fget (Vtoolbar_face, Qbackground_pixmap, Qnil),
@@ -2584,6 +2619,8 @@ complex_vars_of_faces (void)
set_specifier_fallback (Fget (Vvertical_divider_face, Qforeground, Qunbound),
Fget (Vgui_element_face, Qforeground, Qunbound));
+ set_specifier_fallback (Fget (Vvertical_divider_face, Qforeback, Qunbound),
+ Fget (Vgui_element_face, Qforeback, Qunbound));
set_specifier_fallback (Fget (Vvertical_divider_face, Qbackground, Qunbound),
Fget (Vgui_element_face, Qbackground, Qunbound));
set_specifier_fallback (Fget (Vvertical_divider_face, Qbackground_pixmap,
@@ -2604,6 +2641,8 @@ complex_vars_of_faces (void)
Fget (Vgui_element_face, Qfont, Qunbound));
set_specifier_fallback (Fget (Vwidget_face, Qforeground, Qunbound),
Fget (Vgui_element_face, Qforeground, Qunbound));
+ set_specifier_fallback (Fget (Vwidget_face, Qforeback, Qunbound),
+ Fget (Vgui_element_face, Qforeback, Qunbound));
set_specifier_fallback (Fget (Vwidget_face, Qbackground, Qunbound),
Fget (Vgui_element_face, Qbackground, Qunbound));
/* We don't want widgets to have a default background pixmap. */
diff --git a/src/faces.h b/src/faces.h
--- a/src/faces.h
+++ b/src/faces.h
@@ -41,6 +41,7 @@ struct Lisp_Face
a face. */
Lisp_Object foreground;
+ Lisp_Object foreback;
Lisp_Object background;
Lisp_Object font;
@@ -160,6 +161,7 @@ struct face_cachel
faces. This is what the _specified flags below are for. */
Lisp_Object foreground;
+ Lisp_Object foreback;
Lisp_Object background;
/* There are currently 128 or 129 possible charsets under Mule. For the
moment we just take the easy way out and allocate space for each
@@ -188,6 +190,7 @@ struct face_cachel
DECLARE_INLINE_LISP_BIT_VECTOR(NUM_LEADING_BYTES) font_specified;
unsigned int foreground_specified :1;
+ unsigned int foreback_specified :1;
unsigned int background_specified :1;
unsigned int display_table_specified :1;
unsigned int background_pixmap_specified :1;
@@ -331,6 +334,8 @@ void default_face_width_and_height (Lisp
(WINDOW_FACE_CACHEL (window, index)->face)
#define WINDOW_FACE_CACHEL_FOREGROUND(window, index) \
(WINDOW_FACE_CACHEL (window, index)->foreground)
+#define WINDOW_FACE_CACHEL_FOREBACK(window, index) \
+ (WINDOW_FACE_CACHEL (window, index)->foreback)
#define WINDOW_FACE_CACHEL_BACKGROUND(window, index) \
(WINDOW_FACE_CACHEL (window, index)->background)
/* #### This can be referenced by various functions,
@@ -391,6 +396,8 @@ Lisp_Object face_property_matching_insta
#define FACE_FOREGROUND(face, domain) \
FACE_PROPERTY_INSTANCE (face, Qforeground, domain, 0, Qzero)
+#define FACE_FOREBACK(face, domain) \
+ FACE_PROPERTY_INSTANCE (face, Qforeback, domain, 0, Qzero)
#define FACE_BACKGROUND(face, domain) \
FACE_PROPERTY_INSTANCE (face, Qbackground, domain, 0, Qzero)
diff --git a/src/fontcolor.c b/src/fontcolor.c
--- a/src/fontcolor.c
+++ b/src/fontcolor.c
@@ -694,10 +694,12 @@ color_validate (Lisp_Object instantiator
if (XVECTOR_LENGTH (instantiator) == 2)
{
Lisp_Object field = XVECTOR_DATA (instantiator)[1];
- if (!EQ (field, Qforeground) && !EQ (field, Qbackground))
+ if (!EQ (field, Qforeground)
+ && !EQ (field, Qforeback)
+ && !EQ (field, Qbackground))
invalid_constant
- ("Inheritance field must be `foreground' or `background'",
- field);
+("Inheritance field must be `foreground', `foreback' or `background'",
+ field);
}
}
}
diff --git a/src/lisp.h b/src/lisp.h
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -5137,12 +5137,13 @@ extern Lisp_Object Qextent_live_p;
extern Lisp_Object Qstart_open;
/* Defined in faces.c */
+extern Lisp_Object Qforeground;
+extern Lisp_Object Qforeback;
extern Lisp_Object Qbackground;
extern Lisp_Object Qbackground_pixmap;
extern Lisp_Object Qblinking;
extern Lisp_Object Qdim;
extern Lisp_Object Qdisplay_table;
-extern Lisp_Object Qforeground;
extern Lisp_Object Qunderline;
extern Lisp_Object Qshrink;
diff --git a/src/redisplay-msw.c b/src/redisplay-msw.c
--- a/src/redisplay-msw.c
+++ b/src/redisplay-msw.c
@@ -293,7 +293,7 @@ mswindows_output_blank (struct window *w
start_pixpos, rb->width,
&db, &dga);
/* blank the background in the appropriate color */
- mswindows_update_dc (hdc, cachel->foreground,
+ mswindows_update_dc (hdc, cachel->foreback,
cachel->background, Qnil);
redisplay_output_pixmap (w, bg_pmap, &db, &dga, rb->findex,
0, 0, 0, TRUE);
@@ -507,8 +507,7 @@ mswindows_output_string (struct window *
redisplay_calculate_display_boxes (dl, xpos + xoffset, 0, 0,
clip_start, width, &db, &dga);
/* blank the background in the appropriate color */
- mswindows_update_dc (hdc,
- cachel->foreground, cachel->background, Qnil);
+ mswindows_update_dc (hdc, cachel->foreback, cachel->background, Qnil);
redisplay_output_pixmap (w, bg_pmap, &db, &dga, findex,
0, 0, 0, TRUE);
/* output pixmap calls this so we have to recall to get correct
diff --git a/src/redisplay-output.c b/src/redisplay-output.c
--- a/src/redisplay-output.c
+++ b/src/redisplay-output.c
@@ -1789,12 +1789,12 @@ redisplay_clear_region (Lisp_Object loca
{
if (w)
{
- fcolor = WINDOW_FACE_CACHEL_FOREGROUND (w, findex);
+ fcolor = WINDOW_FACE_CACHEL_FOREBACK (w, findex);
bcolor = WINDOW_FACE_CACHEL_BACKGROUND (w, findex);
}
else
{
- fcolor = FACE_FOREGROUND (Vdefault_face, locale);
+ fcolor = FACE_FOREBACK (Vdefault_face, locale);
bcolor = FACE_BACKGROUND (Vdefault_face, locale);
}
}
diff --git a/src/redisplay-xlike-inc.c b/src/redisplay-xlike-inc.c
--- a/src/redisplay-xlike-inc.c
+++ b/src/redisplay-xlike-inc.c
@@ -1094,8 +1094,9 @@ XLIKE_output_string (struct window *w, s
&& !NILP (w->text_cursor_visible_p)) || NILP (bg_pmap))
bgc = 0;
else
- bgc = XLIKE_get_gc (f, Qnil, cachel->foreground, cachel->background,
- bg_pmap, cachel->background_placement, Qnil);
+ bgc = XLIKE_get_gc
+ (f, Qnil, NILP (bg_pmap) ? cachel->foreground : cachel->foreback,
+ cachel->background, bg_pmap, cachel->background_placement, Qnil);
if (bgc)
{
@@ -1895,7 +1896,7 @@ XLIKE_output_blank (struct window *w, st
gc = XLIKE_get_gc (f, Qnil, WINDOW_FACE_CACHEL_BACKGROUND (w, rb->findex),
Qnil, Qnil, Qnil, Qnil);
else
- gc = XLIKE_get_gc (f, Qnil, WINDOW_FACE_CACHEL_FOREGROUND (w, rb->findex),
+ gc = XLIKE_get_gc (f, Qnil, WINDOW_FACE_CACHEL_FOREBACK (w, rb->findex),
WINDOW_FACE_CACHEL_BACKGROUND (w, rb->findex),
bg_pmap,
WINDOW_FACE_CACHEL_BACKGROUND_PLACEMENT (w, rb->findex),
--
Resistance is futile. You will be jazzimilated.
Scientific site: http://www.lrde.epita.fr/~didier
Music (Jazz) site: http://www.didierverna.com
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
commit/XEmacs: didierverna: text_width methods interface cleanup.
12 years, 12 months
Bitbucket
1 new commit in XEmacs:
https://bitbucket.org/xemacs/xemacs/changeset/81fee4aee9b6/
changeset: 81fee4aee9b6
user: didierverna
date: 2011-12-28 11:21:38
summary: text_width methods interface cleanup.
-------------------- ChangeLog entries follow: --------------------
src/ChangeLog addition:
2011-12-28 Didier Verna <didier(a)xemacs.org>
* console-impl.h (struct console_methods): Have the text_width
methods expect a frame instead of a window pointer.
* console-stream.c (stream_text_width):
* redisplay-msw.c (mswindows_text_width):
* redisplay-tty.c (tty_text_width):
* redisplay-xlike-inc.c (XLIKE_text_width): Update accordingly.
* redisplay-msw.c (mswindows_output_string):
* redisplay-xlike-inc.c (XLIKE_output_string):
* redisplay.c (redisplay_window_text_width_ichar_string):
* redisplay.c (redisplay_text_width_string): Update the callers.
This also fixes an uncertainty about always getting a window from
a domain.
affected #: 7 files
Repository URL: https://bitbucket.org/xemacs/xemacs/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
commit/XEmacs: didierverna: text_width_single_run cleanup.
12 years, 12 months
Bitbucket
1 new commit in XEmacs:
https://bitbucket.org/xemacs/xemacs/changeset/37fb945697f5/
changeset: 37fb945697f5
user: didierverna
date: 2011-12-28 10:53:38
summary: text_width_single_run cleanup.
-------------------- ChangeLog entries follow: --------------------
src/ChangeLog addition:
2011-12-28 Didier Verna <didier(a)xemacs.org>
* redisplay-xlike-inc.c (XLIKE_text_width_single_run): Get only
what's needed as argument: an XLIKE_DISPLAY instead of a frame
pointer.
* redisplay-xlike-inc.c (XLIKE_text_width):
* redisplay-xlike-inc.c (XLIKE_output_string): Update accordingly.
Use the generic XLIKE_ name instead of the specific x_ one.
affected #: 2 files
Repository URL: https://bitbucket.org/xemacs/xemacs/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
commit/XEmacs: 2 new changesets
12 years, 12 months
Bitbucket
2 new commits in XEmacs:
https://bitbucket.org/xemacs/xemacs/changeset/6fa0c5fb6154/
changeset: 6fa0c5fb6154
user: didierverna
date: 2011-12-27 18:27:59
summary: One comment.
-------------------- ChangeLog entries follow: --------------------
src/ChangeLog addition:
2011-12-27 Didier Verna <didier(a)xemacs.org>
* faces.c: Add a comment about the way background pixmaps are
handled right now, just above MAYBE_UNFROB_BACKGROUND_PIXMAP.
affected #: 2 files
https://bitbucket.org/xemacs/xemacs/changeset/eb41da9b4469/
changeset: eb41da9b4469
user: didierverna
date: 2011-12-27 21:59:03
summary: More documentation about glyphs cache coherency problem.
-------------------- ChangeLog entries follow: --------------------
src/ChangeLog addition:
2011-12-27 Didier Verna <didier(a)xemacs.org>
* glyphs.c (update_image_instance):
* glyphs.c (image_instantiate): More comments about the current
glyphs cache coherency problem.
affected #: 2 files
Repository URL: https://bitbucket.org/xemacs/xemacs/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
commit/XEmacs: didierverna: New "foreback" face property.
12 years, 12 months
Bitbucket
1 new commit in XEmacs:
https://bitbucket.org/xemacs/xemacs/changeset/c39052c921b5/
changeset: c39052c921b5
user: didierverna
date: 2011-12-27 17:07:23
summary: New "foreback" face property.
-------------------- ChangeLog entries follow: --------------------
lisp/ChangeLog addition:
2011-12-27 Didier Verna <didier(a)xemacs.org>
* cl-macs.el (face-foreback): New defsetf.
* faces.el (set-face-property): Document the foreback property.
* faces.el (face-foreback):
* faces.el (face-foreback-instance):
* faces.el (face-foreback-name):
* faces.el (set-face-foreback): New functions.
* faces.el (face-equal):
* faces.el (init-other-random-faces):
* cus-face.el (custom-face-attributes):
* x-faces.el (x-init-face-from-resources): Handle the foreback
property.
src/ChangeLog addition:
2011-12-27 Didier Verna <didier(a)xemacs.org>
* faces.h (struct Lisp_Face): New 'foreback slot.
* faces.h (struct face_cachel): New 'foreback and
'foreback_specified slots.
* faces.h (WINDOW_FACE_CACHEL_FOREBACK):
* faces.h (FACE_FOREBACK): New macros.
* faces.c: Declare Qforeback.
* 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 (mark_face_cachels):
* faces.c (update_face_cachel_data):
* faces.c (merge_face_cachel_data):
* faces.c (reset_face_cachel):
* faces.c (face_property_was_changed):
* faces.c (Fcopy_face):
* fontcolor.c (face_color_validate): Handle the foreback property.
* redisplay-msw.c (mswindows_output_blank):
* redisplay-msw.c (mswindows_output_string):
* redisplay-output.c (redisplay_clear_region):
* redisplay-xlike-inc.c (XLIKE_output_string):
* redisplay-xlike-inc.c (XLIKE_output_blank): Use the face's
foreback color instead of the foreground one for drawing a
background bitmap.
affected #: 13 files
Repository URL: https://bitbucket.org/xemacs/xemacs/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
[COMMIT] Explicitely set zmacs-region to not shrink
12 years, 12 months
Didier Verna
NOTE: This patch has been committed.
Hi again,
we need to set zmacs-region to not shrink explicitely. Otherwise, an
explicit shrink setting under it will procude weird effect.
lisp/ChangeLog addition:
2011-12-27 Didier Verna <didier(a)xemacs.org>
* faces.el: Explicitely set the 'zmacs-region face to not shrink
so as to override a shrink setting for a face under it (during
face merging).
XEmacs 21.5 source patch:
Diff command: hg diff --git --show-function
Files affected: lisp/faces.el
diff --git a/lisp/faces.el b/lisp/faces.el
--- a/lisp/faces.el
+++ b/lisp/faces.el
@@ -2113,6 +2113,9 @@ in that frame; otherwise change each fra
'(((win default mono) . "gray1"))
'global)
+;; We need to set this face to not shrink *explicitely* in order to force
+;; covering a shrinked selection. -- dvl
+(set-face-shrink-p 'zmacs-region nil)
(set-face-background 'zmacs-region
'(((win default color) . "gray65")
((win default grayscale) . "gray65"))
--
Resistance is futile. You will be jazzimilated.
Scientific site: http://www.lrde.epita.fr/~didier
Music (Jazz) site: http://www.didierverna.com
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches