* src/dispextern.h (enum face_underline_type): Add FACE_NO_UNDERLINE = 0.
(struct face): Merge `underline_type` and `underline_p` into `underline`.
Update all the occurrences in src/xdisp.c, src/xfaces.c, and src/xterm.c.
LFACE_INHERIT_INDEX,
LFACE_FONTSET_INDEX,
LFACE_DISTANT_FOREGROUND_INDEX,
+ LFACE_EXTEND_INDEX,
LFACE_VECTOR_SIZE
};
enum face_underline_type
{
+ FACE_NO_UNDERLINE = 0,
FACE_UNDER_LINE,
FACE_UNDER_WAVE
};
ENUM_BF (face_box_type) box : 2;
/* Style of underlining. */
- ENUM_BF (face_underline_type) underline_type : 1;
+ ENUM_BF (face_underline_type) underline : 2;
/* If `box' above specifies a 3D type, true means use box_color for
drawing shadows. */
/* Non-zero if text in this face should be underlined, overlined,
strike-through or have a box drawn around it. */
- bool_bf underline_p : 1;
bool_bf overline_p : 1;
bool_bf strike_through_p : 1;
bool_bf foreground_defaulted_p : 1;
bool_bf background_defaulted_p : 1;
- /* True means that either no color is specified for underlining or that
- the specified color couldn't be loaded. Use the foreground
- color when drawing in that case. */
- bool_bf underline_defaulted_p : 1;
-
/* True means that either no color is specified for the corresponding
attribute or that the specified color couldn't be loaded.
Use the foreground color when drawing in that case. */
+ bool_bf underline_defaulted_p : 1;
bool_bf overline_color_defaulted_p : 1;
bool_bf strike_through_color_defaulted_p : 1;
bool_bf box_color_defaulted_p : 1;
return;
/* Do underline. */
- if (face->underline_p)
+ if (face->underline)
{
- if (s->face->underline_type == FACE_UNDER_WAVE)
+ if (s->face->underline == FACE_UNDER_WAVE)
{
if (face->underline_defaulted_p)
[defaultCol set];
ns_draw_underwave (s, width, x);
}
- else if (s->face->underline_type == FACE_UNDER_LINE)
+ else if (s->face->underline == FACE_UNDER_LINE)
{
NSRect r;
unsigned long thickness, position;
/* If the prev was underlined, match its appearance. */
- if (s->prev && s->prev->face->underline_p
- && s->prev->face->underline_type == FACE_UNDER_LINE
+ if (s->prev
+ && s->prev->face->underline == FACE_UNDER_LINE
&& s->prev->underline_thickness > 0)
{
thickness = s->prev->underline_thickness;
if (!s->for_overlaps)
{
/* Draw underline. */
- if (s->face->underline_p)
+ if (s->face->underline)
{
- if (s->face->underline_type == FACE_UNDER_WAVE)
+ if (s->face->underline == FACE_UNDER_WAVE)
{
COLORREF color;
w32_draw_underwave (s, color);
}
- else if (s->face->underline_type == FACE_UNDER_LINE)
+ else if (s->face->underline == FACE_UNDER_LINE)
{
unsigned long thickness, position;
int y;
- if (s->prev && s->prev->face->underline_p
- && s->prev->face->underline_type == FACE_UNDER_LINE)
+ if (s->prev
+ && s->prev->face->underline == FACE_UNDER_LINE)
{
/* We use the same underline style as the previous one. */
thickness = s->prev->underline_thickness;
BOOL use_underline_position_properties;
Lisp_Object val
= buffer_local_value (Qunderline_minimum_offset,
- s->w->contents);
+ s->w->contents);
if (FIXNUMP (val))
minimum_offset = max (0, XFIXNUM (val));
else
for (g = s->first_glyph - 1; g >= g0; g--)
{
struct face *prev_face = FACE_FROM_ID (s->f, g->face_id);
- if (!(prev_face && prev_face->underline_p))
+ if (!(prev_face && prev_face->underline != FACE_NO_UNDERLINE))
break;
}
IF_DEBUG (--ncolors_allocated);
}
- if (face->underline_p
+ if (face->underline
&& !face->underline_defaulted_p)
{
x_free_colors (f, &face->underline_color, 1);
if (EQ (underline, Qt))
{
/* Use default color (same as foreground color). */
- face->underline_p = true;
- face->underline_type = FACE_UNDER_LINE;
+ face->underline = FACE_UNDER_LINE;
face->underline_defaulted_p = true;
face->underline_color = 0;
}
else if (STRINGP (underline))
{
/* Use specified color. */
- face->underline_p = true;
- face->underline_type = FACE_UNDER_LINE;
+ face->underline = FACE_UNDER_LINE;
face->underline_defaulted_p = false;
face->underline_color
= load_color (f, face, underline,
}
else if (NILP (underline))
{
- face->underline_p = false;
+ face->underline = FACE_NO_UNDERLINE;
face->underline_defaulted_p = false;
face->underline_color = 0;
}
{
/* `(:color COLOR :style STYLE)'.
STYLE being one of `line' or `wave'. */
- face->underline_p = true;
+ face->underline = FACE_UNDER_LINE;
face->underline_color = 0;
face->underline_defaulted_p = true;
- face->underline_type = FACE_UNDER_LINE;
/* FIXME? This is also not robust about checking the precise form.
See comments in Finternal_set_lisp_face_attribute. */
else if (EQ (keyword, QCstyle))
{
if (EQ (value, Qline))
- face->underline_type = FACE_UNDER_LINE;
+ face->underline = FACE_UNDER_LINE;
else if (EQ (value, Qwave))
- face->underline_type = FACE_UNDER_WAVE;
+ face->underline = FACE_UNDER_WAVE;
}
}
}
{
struct frame *f = WINDOW_XFRAME (w);
Lisp_Object attrs[LFACE_VECTOR_SIZE];
- struct face *base_face;
+ struct face *base_face = FACE_FROM_ID_OR_NULL (f, base_face_id);
- base_face = FACE_FROM_ID_OR_NULL (f, base_face_id);
if (!base_face)
return base_face_id;
}
else
{
- struct face *face;
if (face_id < 0)
return base_face_id;
- face = FACE_FROM_ID_OR_NULL (f, face_id);
+
+ struct face *face = FACE_FROM_ID_OR_NULL (f, face_id);
+
if (!face)
return base_face_id;
+
merge_face_vectors (w, f, face->lface, attrs, 0);
}
#endif
fprintf (stderr, "fontset: %d\n", face->fontset);
fprintf (stderr, "underline: %d (%s)\n",
- face->underline_p,
+ face->underline,
SDATA (Fsymbol_name (face->lface[LFACE_UNDERLINE_INDEX])));
fprintf (stderr, "hash: %" PRIuPTR "\n", face->hash);
}
if (!s->for_overlaps)
{
/* Draw underline. */
- if (s->face->underline_p)
+ if (s->face->underline)
{
- if (s->face->underline_type == FACE_UNDER_WAVE)
+ if (s->face->underline == FACE_UNDER_WAVE)
{
if (s->face->underline_defaulted_p)
x_draw_underwave (s);
XSetForeground (display, s->gc, xgcv.foreground);
}
}
- else if (s->face->underline_type == FACE_UNDER_LINE)
+ else if (s->face->underline == FACE_UNDER_LINE)
{
unsigned long thickness, position;
int y;
- if (s->prev && s->prev->face->underline_p
- && s->prev->face->underline_type == FACE_UNDER_LINE)
+ if (s->prev &&
+ s->prev->face->underline == FACE_UNDER_LINE)
{
/* We use the same underline style as the previous one. */
thickness = s->prev->underline_thickness;