#include "msdos.h"
#endif
+INLINE_HEADER_BEGIN
+#ifndef DISPEXTERN_INLINE
+# define DISPEXTERN_INLINE INLINE
+#endif
+
+#include <c-strcase.h>
+DISPEXTERN_INLINE int
+xstrcasecmp (char const *a, char const *b)
+{
+ return c_strcasecmp (a, b);
+}
+
#ifdef HAVE_X_WINDOWS
typedef struct x_display_info Display_Info;
typedef XImage * XImagePtr;
typedef XImagePtr XImagePtr_or_DC;
#endif
+#ifdef HAVE_WINDOW_SYSTEM
+# include "systime.h"
+#endif
+
#ifndef HAVE_WINDOW_SYSTEM
typedef int Cursor;
#define No_Cursor (0)
Debugging
***********************************************************************/
-/* If GLYPH_DEBUG is non-zero, additional checks are activated. Turn
- it off by defining the macro GLYPH_DEBUG to zero. */
+/* If GLYPH_DEBUG is defined, additional checks are activated. */
-#ifndef GLYPH_DEBUG
-#define GLYPH_DEBUG 0
-#endif
-
-/* If XASSERTS is non-zero, additional consistency checks are activated.
- Turn it off by defining the macro XASSERTS to zero. */
-
-#ifndef XASSERTS
-#define XASSERTS 0
-#endif
-
-/* Macros to include code only if GLYPH_DEBUG != 0. */
+/* Macros to include code only if GLYPH_DEBUG is defined. */
-#if GLYPH_DEBUG
+#ifdef GLYPH_DEBUG
#define IF_DEBUG(X) X
#else
#define IF_DEBUG(X) (void) 0
#endif
-#if XASSERTS
-#define xassert(X) do {if (!(X)) abort ();} while (0)
-#else
-#define xassert(X) (void) 0
-#endif
-
/* Macro for displaying traces of redisplay. If Emacs was compiled
- with GLYPH_DEBUG != 0, the variable trace_redisplay_p can be set to
+ with GLYPH_DEBUG defined, the variable trace_redisplay_p can be set to
a non-zero value in debugging sessions to activate traces. */
-#if GLYPH_DEBUG
+#ifdef GLYPH_DEBUG
extern int trace_redisplay_p EXTERNALLY_VISIBLE;
#include <stdio.h>
else \
(void) 0
-#else /* GLYPH_DEBUG == 0 */
+#else /* not GLYPH_DEBUG */
#define TRACE(X) (void) 0
-#endif /* GLYPH_DEBUG == 0 */
+#endif /* GLYPH_DEBUG */
\f
/* Length of acronym or hexadecimal code string (at most 8). */
unsigned len : 4;
/* Character to display. Actually we need only 22 bits. */
- unsigned ch : 26;
+ unsigned ch : 25;
} glyphless;
/* Used to compare all bit-fields above in one step. */
line. */
unsigned header_line_p : 1;
-#if GLYPH_DEBUG
+#ifdef GLYPH_DEBUG
/* A string identifying the method used to display the matrix. */
char method[512];
#endif
/* Values of BEGV and ZV as of last redisplay. Set in
mark_window_display_accurate_1. */
- int begv, zv;
+ ptrdiff_t begv, zv;
};
/* Check that glyph pointers stored in glyph rows of MATRIX are okay.
This aborts if any pointer is found twice. */
-#if GLYPH_DEBUG
+#ifdef GLYPH_DEBUG
void check_matrix_pointer_lossage (struct glyph_matrix *);
#define CHECK_MATRIX(MATRIX) check_matrix_pointer_lossage ((MATRIX))
#else
/* Get a pointer to row number ROW in matrix MATRIX. If GLYPH_DEBUG
- is defined to a non-zero value, the function matrix_row checks that
- we don't try to access rows that are out of bounds. */
+ is defined, the function matrix_row checks that we don't try to
+ access rows that are out of bounds. */
-#if GLYPH_DEBUG
+#ifdef GLYPH_DEBUG
struct glyph_row *matrix_row (struct glyph_matrix *, int);
#define MATRIX_ROW(MATRIX, ROW) matrix_row ((MATRIX), (ROW))
#else
((ROW)->phys_height - (ROW)->phys_ascent \
> (ROW)->height - (ROW)->ascent)
-/* Non-zero means that fonts have been loaded since the last glyph
+/* True means that fonts have been loaded since the last glyph
matrix adjustments. The function redisplay_internal adjusts glyph
- matrices when this flag is non-zero. */
+ matrices when this flag is true. */
-extern int fonts_changed_p;
+extern bool fonts_changed_p;
/* A glyph for a space. */
/* Non-zero means last display completed. Zero means it was
preempted. */
-extern int display_completed;
+extern bool display_completed;
\f
? current_mode_line_height \
: (MATRIX_MODE_LINE_HEIGHT ((W)->current_matrix) \
? MATRIX_MODE_LINE_HEIGHT ((W)->current_matrix) \
- : estimate_mode_line_height (XFRAME ((W)->frame), \
+ : estimate_mode_line_height (XFRAME (W->frame), \
CURRENT_MODE_LINE_FACE_ID (W))))
/* Return the current height of the header line of window W. If not
? current_header_line_height \
: (MATRIX_HEADER_LINE_HEIGHT ((W)->current_matrix) \
? MATRIX_HEADER_LINE_HEIGHT ((W)->current_matrix) \
- : estimate_mode_line_height (XFRAME ((W)->frame), \
+ : estimate_mode_line_height (XFRAME (W->frame),\
HEADER_LINE_FACE_ID)))
/* Return the height of the desired mode line of window W. */
(!MINI_WINDOW_P ((W)) \
&& !(W)->pseudo_window_p \
&& FRAME_WANTS_MODELINE_P (XFRAME (WINDOW_FRAME ((W)))) \
- && BUFFERP ((W)->buffer) \
- && !NILP (BVAR (XBUFFER ((W)->buffer), mode_line_format)) \
+ && BUFFERP (W->buffer) \
+ && !NILP (BVAR (XBUFFER (W->buffer), mode_line_format)) \
&& WINDOW_TOTAL_LINES (W) > 1)
-/* Value is non-zero if window W wants a header line. */
+/* Value is true if window W wants a header line. */
#define WINDOW_WANTS_HEADER_LINE_P(W) \
(!MINI_WINDOW_P ((W)) \
&& !(W)->pseudo_window_p \
&& FRAME_WANTS_MODELINE_P (XFRAME (WINDOW_FRAME ((W)))) \
- && BUFFERP ((W)->buffer) \
- && !NILP (BVAR (XBUFFER ((W)->buffer), header_line_format)) \
- && WINDOW_TOTAL_LINES (W) > 1 + !NILP (BVAR (XBUFFER ((W)->buffer), mode_line_format)))
+ && BUFFERP (W->buffer) \
+ && !NILP (BVAR (XBUFFER (W->buffer), header_line_format)) \
+ && WINDOW_TOTAL_LINES (W) > 1 \
+ + !NILP (BVAR (XBUFFER (W->buffer), mode_line_format)))
/* Return proper value to be used as baseline offset of font that has
FACE_SUNKEN_BOX
};
+/* Underline type. */
+
+enum face_underline_type
+{
+ FACE_UNDER_LINE,
+ FACE_UNDER_WAVE
+};
/* Structure describing a realized face.
drawing shadows. */
unsigned use_box_color_for_shadows_p : 1;
+ /* Style of underlining. */
+ enum face_underline_type underline_type;
+
/* 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 strike_through_color_defaulted_p : 1;
unsigned box_color_defaulted_p : 1;
- /* TTY appearances. Blinking is not yet implemented. Colors are
- found in `lface' with empty color string meaning the default
- color of the TTY. */
+ /* TTY appearances. Colors are found in `lface' with empty color
+ string meaning the default color of the TTY. */
unsigned tty_bold_p : 1;
- unsigned tty_dim_p : 1;
+ unsigned tty_italic_p : 1;
unsigned tty_underline_p : 1;
- unsigned tty_alt_charset_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
int resolved_level; /* final resolved level of this character */
int invalid_levels; /* how many PDFs to ignore */
int invalid_rl_levels; /* how many PDFs from RLE/RLO to ignore */
- int prev_was_pdf; /* if non-zero, previous char was PDF */
struct bidi_saved_info prev; /* info about previous character */
struct bidi_saved_info last_strong; /* last-seen strong directional char */
struct bidi_saved_info next_for_neutral; /* surrounding characters for... */
struct bidi_string_data string; /* string to reorder */
bidi_dir_t paragraph_dir; /* current paragraph direction */
ptrdiff_t separator_limit; /* where paragraph separator should end */
+ unsigned prev_was_pdf : 1; /* if non-zero, previous char was PDF */
unsigned first_elt : 1; /* if non-zero, examine current char first */
unsigned new_paragraph : 1; /* if non-zero, we expect a new paragraph */
unsigned frame_window_p : 1; /* non-zero if displaying on a GUI frame */
ptrdiff_t lookback;
/* If non-negative, number of glyphs of the glyph-string. */
int nglyphs;
- /* Nonzero iff the composition is created while buffer is scanned in
+ /* True iff the composition is created while buffer is scanned in
reverse order, and thus the grapheme clusters must be rendered
from the last to the first. */
- int reversed_p;
+ bool reversed_p;
/** The following members contain information about the current
grapheme cluster. */
Don't handle some `display' properties in these strings. */
unsigned string_from_display_prop_p : 1;
+ /* 1 means `string' comes from a `line-prefix' or `wrap-prefix'
+ property. */
+ unsigned string_from_prefix_prop_p : 1;
+
/* 1 means we are iterating an object that came from a value of a
`display' property. */
unsigned from_disp_prop_p : 1;
struct display_pos current;
/* Total number of overlay strings to process. This can be >
- OVERLAY_STRING_CHUNK_SIZE. */
+ OVERLAY_STRING_CHUNK_SIZE. Value is dependable only when
+ current.overlay_string_index >= 0. Use the latter to determine
+ whether an overlay string is being iterated over, because
+ n_overlay_strings can be positive even when we are not rendering
+ an overlay string. */
ptrdiff_t n_overlay_strings;
/* The charpos where n_overlay_strings was calculated. This should
/* If non-nil, a Lisp string being processed. If
current.overlay_string_index >= 0, this is an overlay string from
- pos. */
+ pos. Use STRINGP (it.string) to test whether we are rendering a
+ string or something else; do NOT use BUFFERP (it.object). */
Lisp_Object string;
/* If non-nil, we are processing a string that came
bidi_dir_t paragraph_embedding;
unsigned multibyte_p : 1;
unsigned string_from_display_prop_p : 1;
+ unsigned string_from_prefix_prop_p : 1;
unsigned display_ellipsis_p : 1;
unsigned avoid_cursor_p : 1;
unsigned bidi_p:1;
and continuation glyphs, or blanks that extend each line to the
edge of the window on a TTY.
+ Do NOT use !BUFFERP (it.object) as a test whether we are
+ iterating over a string; use STRINGP (it.string) instead.
+
Position is the current iterator position in object. */
Lisp_Object object;
struct text_pos position;
{
/* The time in seconds at which the image was last displayed. Set
in prepare_image_for_display. */
- time_t timestamp;
+ EMACS_TIME timestamp;
/* Pixmaps of the image. */
Pixmap pixmap, mask;
#define TTY_CAP_UNDERLINE 0x02
#define TTY_CAP_BOLD 0x04
#define TTY_CAP_DIM 0x08
-#define TTY_CAP_BLINK 0x10
-#define TTY_CAP_ALT_CHARSET 0x20
+#define TTY_CAP_ITALIC 0x10
\f
/***********************************************************************
/* Defined in bidi.c */
-extern void bidi_init_it (ptrdiff_t, ptrdiff_t, int, struct bidi_it *);
+extern void bidi_init_it (ptrdiff_t, ptrdiff_t, bool, struct bidi_it *);
extern void bidi_move_to_visually_next (struct bidi_it *);
-extern void bidi_paragraph_init (bidi_dir_t, struct bidi_it *, int);
+extern void bidi_paragraph_init (bidi_dir_t, struct bidi_it *, bool);
extern int bidi_mirror_char (int);
extern void bidi_push_it (struct bidi_it *);
extern void bidi_pop_it (struct bidi_it *);
extern void *bidi_shelve_cache (void);
-extern void bidi_unshelve_cache (void *, int);
+extern void bidi_unshelve_cache (void *, bool);
/* Defined in xdisp.c */
struct bidi_string_data *);
extern void produce_stretch_glyph (struct it *);
-
#ifdef HAVE_WINDOW_SYSTEM
-#if GLYPH_DEBUG
+#ifdef GLYPH_DEBUG
extern void dump_glyph_string (struct glyph_string *) EXTERNALLY_VISIBLE;
#endif
int update_window_fringes (struct window *, int);
void compute_fringe_widths (struct frame *, int);
-#ifdef WINDOWSNT
+#ifdef HAVE_NTGUI
void w32_init_fringe (struct redisplay_interface *);
void w32_reset_fringes (void);
#endif
char *choose_face_font (struct frame *, Lisp_Object *, Lisp_Object,
int *);
void prepare_face_for_display (struct frame *, struct face *);
-int xstrcasecmp (const char *, const char *);
int lookup_named_face (struct frame *, Lisp_Object, int);
int lookup_basic_face (struct frame *, int);
int smaller_face (struct frame *, int, int);
#ifdef HAVE_X_WINDOWS
void gamma_correct (struct frame *, XColor *);
#endif
-#ifdef WINDOWSNT
+#ifdef HAVE_NTGUI
void gamma_correct (struct frame *, COLORREF *);
#endif
extern Lisp_Object tip_frame;
extern Window tip_window;
-EXFUN (Fx_hide_tip, 0);
extern void start_hourglass (void);
extern void cancel_hourglass (void);
-extern int hourglass_started (void);
extern int hourglass_shown_p;
struct atimer; /* Defined in atimer.h. */
/* If non-null, an asynchronous timer that, when it expires, displays
extern void redraw_frame (struct frame *);
extern void cancel_line (int, struct frame *);
extern void init_desired_glyphs (struct frame *);
-extern int update_frame (struct frame *, int, int);
+extern bool update_frame (struct frame *, bool, bool);
extern void bitch_at_user (void);
void adjust_glyphs (struct frame *);
void free_glyphs (struct frame *);
void increment_matrix_positions (struct glyph_matrix *,
int, int, ptrdiff_t, ptrdiff_t);
void blank_row (struct window *, struct glyph_row *, int);
-void enable_glyph_matrix_rows (struct glyph_matrix *, int, int, int);
+void clear_glyph_matrix_rows (struct glyph_matrix *, int, int);
void clear_glyph_row (struct glyph_row *);
void prepare_desired_row (struct glyph_row *);
-void set_window_update_flags (struct window *, int);
-void update_single_window (struct window *, int);
-void do_pending_window_change (int);
-void change_frame_size (struct frame *, int, int, int, int, int);
+void set_window_update_flags (struct window *, bool);
+void update_single_window (struct window *, bool);
+void do_pending_window_change (bool);
+void change_frame_size (struct frame *, int, int, bool, bool, bool);
void init_display (void);
void syms_of_display (void);
extern Lisp_Object Qredisplay_dont_pause;
extern int per_line_cost (const char *);
extern void calculate_costs (struct frame *);
extern void produce_glyphs (struct it *);
-extern void produce_special_glyphs (struct it *, enum display_element_type);
extern int tty_capable_p (struct tty_display_info *, unsigned, unsigned long, unsigned long);
extern void set_tty_color_mode (struct tty_display_info *, struct frame *);
extern struct terminal *get_named_tty (const char *);
-EXFUN (Ftty_type, 1);
-EXFUN (Fcontrolling_tty_p, 1);
extern void create_tty_output (struct frame *);
extern struct terminal *init_tty (const char *, const char *, int);
extern void tty_append_glyph (struct it *);
#endif /* HAVE_WINDOW_SYSTEM */
+INLINE_HEADER_END
+
#endif /* not DISPEXTERN_H_INCLUDED */