/* Type of font used to display the character glyph. Used to
determine which set of functions to use to obtain font metrics
for the glyph. Value should be an enumerator of the type
- w32_char_font_type. */
+ w32_char_font_type. */
unsigned w32_font_type : 2;
#endif
/* Construct a glyph code from a character glyph GLYPH. If the
character is multibyte, return -1 as we can't use glyph table for a
- multibyte character. */
+ multibyte character. */
#define GLYPH_FROM_CHAR_GLYPH(GLYPH) \
((GLYPH).u.ch < 256 \
to any text; it is some buffer position if the row corresponds to
an empty display line that displays a line end. This is what old
redisplay used to do. (Except in code for terminal frames, this
- kludge is no longer use, I believe. --gerd).
+ kludge is no longer used, I believe. --gerd).
See also start, end, displays_text_p and ends_at_zv_p for cleaner
ways to do it. The special meaning of positions 0 and -1 will be
of lbearing or rbearing. */
unsigned contains_overlapping_glyphs_p : 1;
- /* 1 means this row is a wide as the window it is displayed in, including
- scroll bars, bitmap areas, and internal borders. This also
+ /* 1 means this row is as wide as the window it is displayed in, including
+ scroll bars, fringes, and internal borders. This also
implies that the row doesn't have marginal areas. */
unsigned full_width_p : 1;
- /* Non-zero means row is a mode or top-line. */
+ /* Non-zero means row is a mode or header-line. */
unsigned mode_line_p : 1;
/* 1 in a current row means this row is overlapped by another row. */
/* 1 means this line starts in the middle of a character consisting
of more than one glyph. Some glyphs have been put in the
- previoius row, the rest are put in this row. */
+ previous row, the rest are put in this row. */
unsigned starts_in_middle_of_char_p : 1;
/* 1 in a current row means this row overlaps others. */
#define MATRIX_MODE_LINE_ROW(MATRIX) \
((MATRIX)->rows + (MATRIX)->nrows - 1)
-/* Return a pointer to the row reserved for the top line in MATRIX.
+/* Return a pointer to the row reserved for the header line in MATRIX.
This is always the first row in MATRIX because that's the only
way that works in frame-based redisplay. */
#define MATRIX_ROW_START_CHARPOS(ROW) ((ROW)->start.pos.charpos)
#define MATRIX_ROW_START_BYTEPOS(ROW) ((ROW)->start.pos.bytepos)
-/* Return character/ byte position at which ROW ends. */
+/* Return the character/ byte position at which ROW ends. */
#define MATRIX_ROW_END_CHARPOS(ROW) ((ROW)->end.pos.charpos)
#define MATRIX_ROW_END_BYTEPOS(ROW) ((ROW)->end.pos.bytepos)
? MATRIX_MODE_LINE_ROW (MATRIX)->height \
: 0)
-/* Return the height of the top line in glyph matrix MATRIX, or zero
+/* Return the height of the header line in glyph matrix MATRIX, or zero
if not known. This macro is called under circumstances where
MATRIX might not have been allocated yet. */
? MATRIX_HEADER_LINE_ROW (MATRIX)->height \
: 0)
+/* Return the desired face id for the mode line of a window, depending
+ on whether the window is selected or not, or if the window is the
+ scrolling window for the currently active minibuffer window.
+
+ Due to the way display_mode_lines manipulates with the contents of
+ selected_window, this macro needs three arguments: SELW which is
+ compared against the current value of selected_window, MBW which is
+ compared against minibuf_window (if SELW doesn't match), and SCRW
+ which is compared against Vminibuf_selected_window (if MBW matches). */
+
+#define CURRENT_MODE_LINE_FACE_ID_3(SELW, MBW, SCRW) \
+ ((!mode_line_in_non_selected_windows \
+ || (SELW) == XWINDOW (selected_window) \
+ || (minibuf_level > 0 \
+ && !NILP (Vminibuf_selected_window) \
+ && (MBW) == XWINDOW (minibuf_window) \
+ && (SCRW) == XWINDOW (Vminibuf_selected_window))) \
+ ? MODE_LINE_FACE_ID \
+ : MODE_LINE_INACTIVE_FACE_ID)
+
+
+/* Return the desired face id for the mode line of window W. */
+
+#define CURRENT_MODE_LINE_FACE_ID(W) \
+ (CURRENT_MODE_LINE_FACE_ID_3((W), XWINDOW (selected_window), (W)))
+
/* Return the current height of the mode line of window W. If not
known from current_mode_line_height, look at W's current glyph
matrix, or return a default based on the height of the font of the
: (MATRIX_MODE_LINE_HEIGHT ((W)->current_matrix) \
? MATRIX_MODE_LINE_HEIGHT ((W)->current_matrix) \
: estimate_mode_line_height (XFRAME ((W)->frame), \
- MODE_LINE_FACE_ID)))
+ CURRENT_MODE_LINE_FACE_ID (W))))
-/* Return the current height of the top line of window W. If not
+/* Return the current height of the header line of window W. If not
known from current_header_line_height, look at W's current glyph
matrix, or return an estimation based on the height of the font of
the face `header-line'. */
#define DESIRED_MODE_LINE_HEIGHT(W) \
MATRIX_MODE_LINE_HEIGHT ((W)->desired_matrix)
-/* Return the height of the desired top line of window W. */
+/* Return the height of the desired header line of window W. */
#define DESIRED_HEADER_LINE_HEIGHT(W) \
MATRIX_HEADER_LINE_HEIGHT ((W)->desired_matrix)
/* Width of display region of window W. For terminal frames, this
equals the width of W since there are no vertical scroll bars. For
window system frames, the value has to be corrected by the pixel
- width of vertical scroll bars, and bitmap areas. */
+ width of vertical scroll bars, and fringes. */
#define WINDOW_DISPLAY_PIXEL_WIDTH(W) \
(((XFASTINT ((W)->width) \
- FRAME_SCROLL_BAR_WIDTH (XFRAME (WINDOW_FRAME ((W)))) \
- - FRAME_FLAGS_AREA_COLS (XFRAME (WINDOW_FRAME ((W))))) \
+ - FRAME_FRINGE_COLS (XFRAME (WINDOW_FRAME ((W))))) \
* CANON_X_UNIT (XFRAME (WINDOW_FRAME ((W))))))
/* Height of the display region of W, including a mode line, if any. */
? CURRENT_MODE_LINE_HEIGHT (W) \
: 0)
-/* Height in pixels of the top line. Zero if W doesn't have a top
+/* Height in pixels of the header line. Zero if W doesn't have a header
line. */
#define WINDOW_DISPLAY_HEADER_LINE_HEIGHT(W) \
(WINDOW_DISPLAY_PIXEL_HEIGHT ((W)) \
- WINDOW_DISPLAY_MODE_LINE_HEIGHT ((W)))
-/* Pixel height of window W without mode and top line. */
+/* Pixel height of window W without mode and header line. */
#define WINDOW_DISPLAY_TEXT_HEIGHT(W) \
(WINDOW_DISPLAY_PIXEL_HEIGHT ((W)) \
(FRAME_INTERNAL_BORDER_WIDTH_SAFE (XFRAME (WINDOW_FRAME ((W)))) \
+ (WINDOW_LEFT_MARGIN ((W)) \
* CANON_X_UNIT (XFRAME (WINDOW_FRAME ((W))))) \
- + FRAME_LEFT_FLAGS_AREA_WIDTH (XFRAME (WINDOW_FRAME ((W)))))
+ + FRAME_LEFT_FRINGE_WIDTH (XFRAME (WINDOW_FRAME ((W)))))
/* Right edge of window W in pixels, relative to its frame. */
#define FRAME_TO_WINDOW_PIXEL_X(W, X) \
((X) - WINDOW_DISPLAY_LEFT_EDGE_PIXEL_X ((W)))
-/* Convert frame relative pixel X to window relative pixel Y. */
+/* Convert frame relative pixel Y to window relative pixel Y. */
#define FRAME_TO_WINDOW_PIXEL_Y(W, Y) \
((Y) - WINDOW_DISPLAY_TOP_EDGE_PIXEL_Y ((W)))
? WINDOW_DISPLAY_LEFT_AREA_PIXEL_WIDTH ((W)) \
: WINDOW_DISPLAY_RIGHT_AREA_PIXEL_WIDTH ((W))))
-/* Value is non-zero if window W has a mode line. */
+/* Value is non-zero if window W wants a mode line. */
#define WINDOW_WANTS_MODELINE_P(W) \
- (!MINI_WINDOW_P (W) \
+ (!MINI_WINDOW_P ((W)) \
&& !(W)->pseudo_window_p \
- && FRAME_WANTS_MODELINE_P (XFRAME (WINDOW_FRAME (W))) \
+ && FRAME_WANTS_MODELINE_P (XFRAME (WINDOW_FRAME ((W)))) \
&& BUFFERP ((W)->buffer) \
- && !NILP (XBUFFER ((W)->buffer)->mode_line_format))
+ && !NILP (XBUFFER ((W)->buffer)->mode_line_format) \
+ && XFASTINT ((W)->height) > 1)
-/* Value is non-zero if window W wants a top line. */
+/* Value is non-zero if window W wants a header line. */
#define WINDOW_WANTS_HEADER_LINE_P(W) \
- (!MINI_WINDOW_P (W) \
+ (!MINI_WINDOW_P ((W)) \
&& !(W)->pseudo_window_p \
- && FRAME_WANTS_MODELINE_P (XFRAME (WINDOW_FRAME (W))) \
+ && FRAME_WANTS_MODELINE_P (XFRAME (WINDOW_FRAME ((W)))) \
&& BUFFERP ((W)->buffer) \
- && !NILP (XBUFFER ((W)->buffer)->header_line_format))
+ && !NILP (XBUFFER ((W)->buffer)->header_line_format) \
+ && XFASTINT ((W)->height) > 1 + !NILP (XBUFFER ((W)->buffer)->mode_line_format))
\f
/***********************************************************************
LFACE_FONT_INDEX,
LFACE_INHERIT_INDEX,
LFACE_AVGWIDTH_INDEX,
+ LFACE_FONTSET_INDEX,
LFACE_VECTOR_SIZE
};
#ifdef HAVE_WINDOW_SYSTEM
- /* If non-zero, a GC we can use without modification to draw
- characters in this face. */
+ /* If non-zero, this is a GC that we can use without modification for
+ drawing the characters in this face. */
GC gc;
/* Font used for this face, or null if the font could not be loaded
reallocated. */
int font_info_id;
- /* Fontset ID if this face uses a fontset, or -1. This is only >= 0
- if the face was realized for a composition sequence.
- Otherwise, a specific font is loaded from the set of fonts
- specified by the fontset given by the family attribute of the face. */
+ /* Fontset ID if for this face's fontset. Non-ASCII faces derived
+ from the same ASCII face have the same fontset. */
int fontset;
/* Pixmap width and height. */
/* Non-zero means characters in this face have a box that thickness
around them. If it is negative, the absolute value indicates the
thickness, and the horizontal lines of box (top and bottom) are
- drawn inside of characters glyph area. The vartical lines of box
+ drawn inside of characters glyph area. The vertical lines of box
(left and right) are drawn as the same way as the case that this
value is positive. */
int box_line_width;
/* The hash value of this face. */
unsigned hash;
- /* The charset for which this face was realized if it was realized
- for use in multibyte text. If fontset >= 0, this is the charset
- of the first character of the composition sequence. A value of
- charset < 0 means the face was realized for use in unibyte text
- where the idea of Emacs charsets isn't applicable. */
- int charset;
-
/* Non-zero if text in this face should be underlined, overlined,
strike-through or have a box drawn around it. */
unsigned underline_p : 1;
unsigned underline_defaulted_p : 1;
/* 1 means that either no color is specified for the corresponding
- attribute or that the the specified color couldn't be loaded.
+ attribute or that the specified color couldn't be loaded.
Use the foreground color when drawing in that case. */
unsigned overline_color_defaulted_p : 1;
unsigned strike_through_color_defaulted_p : 1;
unsigned tty_reverse_p : 1;
unsigned tty_blinking_p : 1;
+ /* 1 means that colors of this face may not be freed because they
+ have been copied bitwise from a base face (see
+ realize_x_face). */
+ unsigned colors_copied_bitwise_p : 1;
+
/* Next and previous face in hash collision list of face cache. */
struct face *next, *prev;
- /* If this face is for ASCII characters, this points this face
- itself. Otherwise, this points a face for ASCII characters. */
+ /* If this face is an ASCII face, this points to this face itself.
+ Otherwise, this points to an ASCII face that has the same
+ attributes except the font. */
struct face *ascii_face;
};
#define FACE_TTY_DEFAULT_FG_COLOR ((unsigned long) -2)
-/* Color index indicating that face uses an unsigned background color. */
+/* Color index indicating that face uses an unknown background color. */
#define FACE_TTY_DEFAULT_BG_COLOR ((unsigned long) -3)
{
DEFAULT_FACE_ID,
MODE_LINE_FACE_ID,
+ MODE_LINE_INACTIVE_FACE_ID,
TOOL_BAR_FACE_ID,
- BITMAP_AREA_FACE_ID,
+ FRINGE_FACE_ID,
HEADER_LINE_FACE_ID,
SCROLL_BAR_FACE_ID,
BORDER_FACE_ID,
/* Non-zero if FACE is suitable for displaying character CHAR. */
#define FACE_SUITABLE_FOR_CHAR_P(FACE, CHAR) \
- (SINGLE_BYTE_CHAR_P (CHAR) \
+ (ASCII_CHAR_P (CHAR) \
? (FACE) == (FACE)->ascii_face \
: face_suitable_for_char_p ((FACE), (CHAR)))
This macro is only meaningful for multibyte character CHAR. */
#define FACE_FOR_CHAR(F, FACE, CHAR) \
- (SINGLE_BYTE_CHAR_P (CHAR) \
+ (ASCII_CHAR_P (CHAR) \
? (FACE)->ascii_face->id \
: face_for_char ((F), (FACE), (CHAR)))
Lisp_Object *dpvec, *dpend;
/* Length in bytes of the char that filled dpvec. A value of zero
- means that no character such character is involved. */
+ means that no such character is involved. */
int dpvec_char_len;
/* Face id of the iterator saved in case a glyph from dpvec contains
int last_visible_y;
/* Additional space in pixels between lines (for window systems
- only.). */
+ only.) */
int extra_line_spacing;
/* If non-null, glyphs are produced in glyph_row with each call to
redisplay. CURSOR_ON_P non-zero means switch cursor on.
MOUSE_FACE_OVERWRITTEN_P non-zero means that some lines in W
that contained glyphs in mouse-face were overwritten, so we
- have to update the mouse hightlight. */
+ have to update the mouse highlight. */
void (*update_window_end_hook) P_ ((struct window *w, int cursor_on_p,
int mouse_face_overwritten_p));
struct image;
-/* Each image format (JPEG, IIFF, ...) supported is described by
+/* Each image format (JPEG, TIFF, ...) supported is described by
a structure of the type below. */
struct image_type
#define DEFAULT_IMAGE_HEIGHT 30
/* Percent of image height used as ascent. A value of
- CENTERED_IMAGE_ASCENT means draw center the image centered on the
+ CENTERED_IMAGE_ASCENT means draw the image centered on the
line. */
int ascent;
#define DEFAULT_IMAGE_ASCENT 50
int tool_bar_item_info P_ ((struct frame *, struct glyph *, int *));
extern Lisp_Object Qtool_bar;
extern Lisp_Object Vshow_trailing_whitespace;
+extern int mode_line_in_non_selected_windows;
extern int redisplaying_p;
extern Lisp_Object Vimage_types;
extern void add_to_log P_ ((char *, Lisp_Object, Lisp_Object));
enum lface_attribute_index));
void unload_color P_ ((struct frame *, unsigned long));
int frame_update_line_height P_ ((struct frame *));
+char *choose_face_font P_ ((struct frame *, Lisp_Object *, Lisp_Object));
int ascii_face_of_lisp_face P_ ((struct frame *, int));
void prepare_face_for_display P_ ((struct frame *, struct face *));
int xstricmp P_ ((unsigned char *, unsigned char *));
-int lookup_face P_ ((struct frame *, Lisp_Object *, int, struct face *));
-int lookup_named_face P_ ((struct frame *, Lisp_Object, int));
+int lookup_face P_ ((struct frame *, Lisp_Object *));
+int lookup_non_ascii_face P_ ((struct frame *, int, struct face *));
+int lookup_named_face P_ ((struct frame *, Lisp_Object));
int smaller_face P_ ((struct frame *, int, int));
int face_with_height P_ ((struct frame *, int, int));
-int lookup_derived_face P_ ((struct frame *, Lisp_Object, int, int));
+int lookup_derived_face P_ ((struct frame *, Lisp_Object, int));
void init_frame_faces P_ ((struct frame *));
void free_frame_faces P_ ((struct frame *));
void recompute_basic_faces P_ ((struct frame *));
int, int *, enum face_id, int));
int compute_char_face P_ ((struct frame *, int, Lisp_Object));
void free_all_realized_faces P_ ((Lisp_Object));
+void free_realized_face P_ ((struct frame *, struct face *));
+
extern Lisp_Object Qforeground_color, Qbackground_color;
extern char unspecified_fg[], unspecified_bg[];
-void free_realized_multibyte_face P_ ((struct frame *, int));
+extern void check_face_attributes P_ ((Lisp_Object, Lisp_Object, Lisp_Object));
+extern Lisp_Object generate_ascii_font_name P_ ((Lisp_Object, Lisp_Object));
+extern Lisp_Object font_name_registry P_ ((Lisp_Object));
/* Defined in xfns.c */
int valid_image_p P_ ((Lisp_Object));
void prepare_image_for_display P_ ((struct frame *, struct image *));
int lookup_image P_ ((struct frame *, Lisp_Object));
+
+#ifdef HAVE_X_WINDOWS
unsigned long image_background P_ ((struct image *, struct frame *,
XImage *ximg));
int image_background_transparent P_ ((struct image *, struct frame *,
XImage *mask));
+#endif /* HAVE_X_WINDOWS */
+
extern Lisp_Object tip_frame;
extern Window tip_window;
EXFUN (Fx_show_tip, 6);
void set_window_update_flags P_ ((struct window *, int));
void write_glyphs P_ ((struct glyph *, int));
void insert_glyphs P_ ((struct glyph *, int));
-void redraw_frame P_ ((struct frame *));
-void redraw_garbaged_frames P_ ((void));
int scroll_cost P_ ((struct frame *, int, int, int));
int direct_output_for_insert P_ ((int));
int direct_output_forward_char P_ ((int));
extern int string_cost P_ ((char *));
extern int per_line_cost P_ ((char *));
extern void calculate_costs P_ ((struct frame *));
+extern void set_tty_color_mode P_ ((struct frame *, Lisp_Object));
+extern void tty_setup_colors P_ ((int));
extern void term_init P_ ((char *));
extern void fatal P_ ((/* char *, ... */));
void cursor_to P_ ((int, int));