aboutsummaryrefslogtreecommitdiffstats
path: root/src/xfaces.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/xfaces.c')
-rw-r--r--src/xfaces.c43
1 files changed, 23 insertions, 20 deletions
diff --git a/src/xfaces.c b/src/xfaces.c
index 1e27d5cc043..b988295e9b6 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -1,6 +1,6 @@
1/* xfaces.c -- "Face" primitives. 1/* xfaces.c -- "Face" primitives.
2 2
3Copyright (C) 1993-1994, 1998-2012 Free Software Foundation, Inc. 3Copyright (C) 1993-1994, 1998-2013 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
@@ -112,7 +112,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
112 merging faces of that character, that face is `realized'. The 112 merging faces of that character, that face is `realized'. The
113 realization process maps face attributes to what is physically 113 realization process maps face attributes to what is physically
114 available on the system where Emacs runs. The result is a 114 available on the system where Emacs runs. The result is a
115 `realized face' in form of a struct face which is stored in the 115 `realized face' in the form of a struct face which is stored in the
116 face cache of the frame on which it was realized. 116 face cache of the frame on which it was realized.
117 117
118 Face realization is done in the context of the character to display 118 Face realization is done in the context of the character to display
@@ -1585,14 +1585,14 @@ the face font sort order. */)
1585 for (i = nfonts - 1; i >= 0; --i) 1585 for (i = nfonts - 1; i >= 0; --i)
1586 { 1586 {
1587 Lisp_Object font = AREF (vec, i); 1587 Lisp_Object font = AREF (vec, i);
1588 Lisp_Object v = Fmake_vector (make_number (8), Qnil); 1588 Lisp_Object v = make_uninit_vector (8);
1589 int point; 1589 int point;
1590 Lisp_Object spacing; 1590 Lisp_Object spacing;
1591 1591
1592 ASET (v, 0, AREF (font, FONT_FAMILY_INDEX)); 1592 ASET (v, 0, AREF (font, FONT_FAMILY_INDEX));
1593 ASET (v, 1, FONT_WIDTH_SYMBOLIC (font)); 1593 ASET (v, 1, FONT_WIDTH_SYMBOLIC (font));
1594 point = PIXEL_TO_POINT (XINT (AREF (font, FONT_SIZE_INDEX)) * 10, 1594 point = PIXEL_TO_POINT (XINT (AREF (font, FONT_SIZE_INDEX)) * 10,
1595 XFRAME (frame)->resy); 1595 FRAME_RES_Y (XFRAME (frame)));
1596 ASET (v, 2, make_number (point)); 1596 ASET (v, 2, make_number (point));
1597 ASET (v, 3, FONT_WEIGHT_SYMBOLIC (font)); 1597 ASET (v, 3, FONT_WEIGHT_SYMBOLIC (font));
1598 ASET (v, 4, FONT_SLANT_SYMBOLIC (font)); 1598 ASET (v, 4, FONT_SLANT_SYMBOLIC (font));
@@ -2118,7 +2118,7 @@ set_lface_from_font (struct frame *f, Lisp_Object lface,
2118 2118
2119 if (force_p || UNSPECIFIEDP (LFACE_HEIGHT (lface))) 2119 if (force_p || UNSPECIFIEDP (LFACE_HEIGHT (lface)))
2120 { 2120 {
2121 int pt = PIXEL_TO_POINT (font->pixel_size * 10, f->resy); 2121 int pt = PIXEL_TO_POINT (font->pixel_size * 10, FRAME_RES_Y (f));
2122 2122
2123 eassert (pt > 0); 2123 eassert (pt > 0);
2124 ASET (lface, LFACE_HEIGHT_INDEX, make_number (pt)); 2124 ASET (lface, LFACE_HEIGHT_INDEX, make_number (pt));
@@ -3395,21 +3395,22 @@ set_font_frame_param (Lisp_Object frame, Lisp_Object lface)
3395 } 3395 }
3396} 3396}
3397 3397
3398
3399/* Get the value of X resource RESOURCE, class CLASS for the display
3400 of frame FRAME. This is here because ordinary `x-get-resource'
3401 doesn't take a frame argument. */
3402
3403DEFUN ("internal-face-x-get-resource", Finternal_face_x_get_resource, 3398DEFUN ("internal-face-x-get-resource", Finternal_face_x_get_resource,
3404 Sinternal_face_x_get_resource, 3, 3, 0, doc: /* */) 3399 Sinternal_face_x_get_resource, 2, 3, 0,
3400 doc: /* Get the value of X resource RESOURCE, class CLASS.
3401Returned value is for the display of frame FRAME. If FRAME is not
3402specified or nil, use selected frame. This function exists because
3403ordinary `x-get-resource' doesn't take a frame argument. */)
3405 (Lisp_Object resource, Lisp_Object class, Lisp_Object frame) 3404 (Lisp_Object resource, Lisp_Object class, Lisp_Object frame)
3406{ 3405{
3407 Lisp_Object value = Qnil; 3406 Lisp_Object value = Qnil;
3407 struct frame *f;
3408
3408 CHECK_STRING (resource); 3409 CHECK_STRING (resource);
3409 CHECK_STRING (class); 3410 CHECK_STRING (class);
3410 CHECK_LIVE_FRAME (frame); 3411 f = decode_live_frame (frame);
3411 block_input (); 3412 block_input ();
3412 value = display_x_get_resource (FRAME_X_DISPLAY_INFO (XFRAME (frame)), 3413 value = display_x_get_resource (FRAME_X_DISPLAY_INFO (f),
3413 resource, class, Qnil, Qnil); 3414 resource, class, Qnil, Qnil);
3414 unblock_input (); 3415 unblock_input ();
3415 return value; 3416 return value;
@@ -4877,6 +4878,8 @@ tty_supports_face_attributes_p (struct frame *f,
4877 { 4878 {
4878 if (STRINGP (val)) 4879 if (STRINGP (val))
4879 return 0; /* ttys can't use colored underlines */ 4880 return 0; /* ttys can't use colored underlines */
4881 else if (EQ (CAR_SAFE (val), QCstyle) && EQ (CAR_SAFE (CDR_SAFE (val)), Qwave))
4882 return 0; /* ttys can't use wave underlines */
4880 else if (face_attr_equal_p (val, def_attrs[LFACE_UNDERLINE_INDEX])) 4883 else if (face_attr_equal_p (val, def_attrs[LFACE_UNDERLINE_INDEX]))
4881 return 0; /* same as default */ 4884 return 0; /* same as default */
4882 else 4885 else
@@ -5961,7 +5964,7 @@ face_at_buffer_position (struct window *w, ptrdiff_t pos,
5961 5964
5962 /* W must display the current buffer. We could write this function 5965 /* W must display the current buffer. We could write this function
5963 to use the frame and buffer of W, but right now it doesn't. */ 5966 to use the frame and buffer of W, but right now it doesn't. */
5964 /* eassert (XBUFFER (w->buffer) == current_buffer); */ 5967 /* eassert (XBUFFER (w->contents) == current_buffer); */
5965 5968
5966 XSETFASTINT (position, pos); 5969 XSETFASTINT (position, pos);
5967 5970
@@ -5971,9 +5974,9 @@ face_at_buffer_position (struct window *w, ptrdiff_t pos,
5971 5974
5972 /* Get the `face' or `mouse_face' text property at POS, and 5975 /* Get the `face' or `mouse_face' text property at POS, and
5973 determine the next position at which the property changes. */ 5976 determine the next position at which the property changes. */
5974 prop = Fget_text_property (position, propname, w->buffer); 5977 prop = Fget_text_property (position, propname, w->contents);
5975 XSETFASTINT (limit1, (limit < endpos ? limit : endpos)); 5978 XSETFASTINT (limit1, (limit < endpos ? limit : endpos));
5976 end = Fnext_single_property_change (position, propname, w->buffer, limit1); 5979 end = Fnext_single_property_change (position, propname, w->contents, limit1);
5977 if (INTEGERP (end)) 5980 if (INTEGERP (end))
5978 endpos = XINT (end); 5981 endpos = XINT (end);
5979 5982
@@ -6069,7 +6072,7 @@ face_for_overlay_string (struct window *w, ptrdiff_t pos,
6069 6072
6070 /* W must display the current buffer. We could write this function 6073 /* W must display the current buffer. We could write this function
6071 to use the frame and buffer of W, but right now it doesn't. */ 6074 to use the frame and buffer of W, but right now it doesn't. */
6072 /* eassert (XBUFFER (w->buffer) == current_buffer); */ 6075 /* eassert (XBUFFER (w->contents) == current_buffer); */
6073 6076
6074 XSETFASTINT (position, pos); 6077 XSETFASTINT (position, pos);
6075 6078
@@ -6079,9 +6082,9 @@ face_for_overlay_string (struct window *w, ptrdiff_t pos,
6079 6082
6080 /* Get the `face' or `mouse_face' text property at POS, and 6083 /* Get the `face' or `mouse_face' text property at POS, and
6081 determine the next position at which the property changes. */ 6084 determine the next position at which the property changes. */
6082 prop = Fget_text_property (position, propname, w->buffer); 6085 prop = Fget_text_property (position, propname, w->contents);
6083 XSETFASTINT (limit1, (limit < endpos ? limit : endpos)); 6086 XSETFASTINT (limit1, (limit < endpos ? limit : endpos));
6084 end = Fnext_single_property_change (position, propname, w->buffer, limit1); 6087 end = Fnext_single_property_change (position, propname, w->contents, limit1);
6085 if (INTEGERP (end)) 6088 if (INTEGERP (end))
6086 endpos = XINT (end); 6089 endpos = XINT (end);
6087 6090
@@ -6150,7 +6153,7 @@ face_at_string_position (struct window *w, Lisp_Object string,
6150 struct frame *f = XFRAME (WINDOW_FRAME (w)); 6153 struct frame *f = XFRAME (WINDOW_FRAME (w));
6151 Lisp_Object attrs[LFACE_VECTOR_SIZE]; 6154 Lisp_Object attrs[LFACE_VECTOR_SIZE];
6152 struct face *base_face; 6155 struct face *base_face;
6153 int multibyte_p = STRING_MULTIBYTE (string); 6156 bool multibyte_p = STRING_MULTIBYTE (string);
6154 Lisp_Object prop_name = mouse_p ? Qmouse_face : Qface; 6157 Lisp_Object prop_name = mouse_p ? Qmouse_face : Qface;
6155 6158
6156 /* Get the value of the face property at the current position within 6159 /* Get the value of the face property at the current position within