/* Interface definitions for display code.
Copyright (C) 1985, 1993, 1994, 1997, 1998, 1999, 2000, 2001, 2002,
- 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+ 2003, 2004, 2005, 2006, 2007, 2008
+ Free Software Foundation, Inc.
This file is part of GNU Emacs.
short used[LAST_AREA];
/* Window-relative x and y-position of the top-left corner of this
- row. If y < 0, this means that abs (y) pixels of the row are
+ row. If y < 0, this means that eabs (y) pixels of the row are
invisible because it is partially visible at the top of a window.
- If x < 0, this means that abs (x) pixels of the first glyph of
+ If x < 0, this means that eabs (x) pixels of the first glyph of
the text area of the row are invisible because the glyph is
partially visible. */
int x, y;
/* Continuation lines width at the start of the row. */
int continuation_lines_width;
+
+#ifdef HAVE_WINDOW_SYSTEM
+ /* Non-NULL means the current clipping area. This is temporarily
+ set while exposing a region. Coordinates are frame-relative. */
+ XRectangle *clip;
+#endif
};
extern struct glyph space_glyph;
-/* Frame being updated by update_window/update_frame. */
-
-extern struct frame *updating_frame;
-
/* Window being updated by update_window. This is non-null as long as
- update_window has not finished, and null otherwise. It's role is
- analogous to updating_frame. */
+ update_window has not finished, and null otherwise. */
extern struct window *updated_window;
*clip_tail, not including their overhangs. */
struct glyph_string *clip_head, *clip_tail;
-#ifdef USE_FONT_BACKEND
- /* The current clipping area. */
- int clip_x, clip_y, clip_width, clip_height;
-#endif /* USE_FONT_BACKEND */
+ /* The current clipping areas. */
+ NativeRectangle clip[2];
+
+ /* Number of clipping areas. */
+ int num_clips;
struct glyph_string *next, *prev;
};
DESCENT = FONT->descent
HEIGHT = FONT_HEIGHT (FONT)
F_DESCENT = (FRAME_FONT (F)->descent
- - F->output_data.x->baseline_offset)
+ - F->terminal->output_data.x->baseline_offset)
F_HEIGHT = FRAME_LINE_HEIGHT (F)
*/
reallocated. */
int font_info_id;
-#ifdef USE_FONT_BACKEND
struct font_info *font_info;
-#endif /* USE_FONT_BACKEND */
/* Fontset ID if for this face's fontset. Non-ASCII faces derived
from the same ASCII face have the same fontset. */
attributes except the font. */
struct face *ascii_face;
-#ifdef USE_FONT_BACKEND
/* Extra member that a font-driver uses privately. */
void *extra;
-#endif /* USE_FONT_BACKEND */
};
Lisp_Object height;
};
+/* Input sources for fetching characters or data to display.
+ The input source is found in the `method' field. */
+
enum it_method {
GET_FROM_BUFFER = 0,
GET_FROM_DISPLAY_VECTOR,
position in overlay strings etc. */
struct display_pos current;
+ /* Total number of overlay strings to process. This can be >
+ OVERLAY_STRING_CHUNK_SIZE. */
+ int n_overlay_strings;
+
/* Vector of overlays to process. Overlay strings are processed
OVERLAY_STRING_CHUNK_SIZE at a time. */
#define OVERLAY_STRING_CHUNK_SIZE 16
Lisp_Object overlay_strings[OVERLAY_STRING_CHUNK_SIZE];
- /* Total number of overlay strings to process. This can be >
- OVERLAY_STRING_CHUNK_SIZE. */
- int n_overlay_strings;
+ /* For each overlay string, the overlay it came from. */
+ Lisp_Object string_overlays[OVERLAY_STRING_CHUNK_SIZE];
/* If non-nil, a Lisp string being processed. If
current.overlay_string_index >= 0, this is an overlay string from
pos. */
Lisp_Object string;
+ /* If non-nil, we are processing a string that came
+ from a `display' property given by an overlay. */
+ Lisp_Object from_overlay;
+
/* Stack of saved values. New entries are pushed when we begin to
process an overlay string or a string from a `glyph' property.
Entries are popped when we return to deliver display elements
/* current text and display positions. */
struct text_pos position;
struct display_pos current;
+ Lisp_Object from_overlay;
enum glyph_row_area area;
enum it_method method;
unsigned multibyte_p : 1;
/* Stack pointer. */
int sp;
- /* Setting of buffer-local variable selective-display-ellipsis. */
- unsigned selective_display_ellipsis_p : 1;
-
- /* 1 means control characters are translated into the form `^C'
- where the `^' can be replaced by a display table entry. */
- unsigned ctl_arrow_p : 1;
-
/* -1 means selective display hides everything between a \r and the
next newline; > 0 means hide lines indented more than that value. */
int selective;
/* Face to use. */
int face_id;
+ /* Setting of buffer-local variable selective-display-ellipsis. */
+ unsigned selective_display_ellipsis_p : 1;
+
+ /* 1 means control characters are translated into the form `^C'
+ where the `^' can be replaced by a display table entry. */
+ unsigned ctl_arrow_p : 1;
+
+ /* 1 means lines are truncated. */
+ unsigned truncate_lines_p : 1;
+
/* Non-zero means that the current face has a box. */
unsigned face_box_p : 1;
Lisp_Object object;
struct text_pos position;
- /* 1 means lines are truncated. */
- unsigned truncate_lines_p : 1;
-
/* Number of columns per \t. */
short tab_width;
/* Call produce_glyphs or produce_glyphs_hook, if set. Shortcut to
avoid the function call overhead. */
-#define PRODUCE_GLYPHS(IT) \
- do { \
- extern int inhibit_free_realized_faces; \
- if (rif != NULL) \
- rif->produce_glyphs ((IT)); \
- else \
- produce_glyphs ((IT)); \
- if ((IT)->glyph_row != NULL) \
- inhibit_free_realized_faces = 1; \
- } while (0)
+#define PRODUCE_GLYPHS(IT) \
+ do { \
+ extern int inhibit_free_realized_faces; \
+ if (FRAME_RIF ((IT)->f) != NULL) \
+ FRAME_RIF ((IT)->f)->produce_glyphs ((IT)); \
+ else \
+ produce_glyphs ((IT)); \
+ if ((IT)->glyph_row != NULL) \
+ inhibit_free_realized_faces = 1; \
+ } while (0)
/* Bit-flags indicating what operation move_it_to should perform. */
#endif /* HAVE_WINDOW_SYSTEM */
};
-/* The current interface for window-based redisplay. */
-
-extern struct redisplay_interface *rif;
-
\f
/***********************************************************************
Images
/* Help string. */
TOOL_BAR_ITEM_HELP,
+ /* Icon file name of right to left image when an RTL locale is used. */
+ TOOL_BAR_ITEM_RTL_IMAGE,
+
/* Sentinel = number of slots in tool_bar_items occupied by one
tool-bar item. */
TOOL_BAR_ITEM_NSLOTS
struct glyph_row *));
int get_next_display_element P_ ((struct it *));
void set_iterator_to_next P_ ((struct it *, int));
-void produce_glyphs P_ ((struct it *));
-void produce_special_glyphs P_ ((struct it *, enum display_element_type));
void start_display P_ ((struct it *, struct window *, struct text_pos));
void move_it_to P_ ((struct it *, int, int, int, int, int));
void move_it_vertically P_ ((struct it *, int));
int update_window_fringes P_ ((struct window *, int));
void compute_fringe_widths P_ ((struct frame *, int));
-#ifdef WINDOWS_NT
-void w32_init_fringe P_ ((void));
+#ifdef WINDOWSNT
+void w32_init_fringe P_ ((struct redisplay_interface *));
void w32_reset_fringes P_ ((void));
#endif
#ifdef MAC_OS
-void mac_init_fringe P_ ((void));
+void mac_init_fringe P_ ((struct redisplay_interface *));
#endif
/* Defined in image.c */
/* Defined in sysdep.c */
-void get_frame_size P_ ((int *, int *));
+void get_tty_size P_ ((int, int *, int *));
void request_sigio P_ ((void));
void unrequest_sigio P_ ((void));
-int tabs_safe_p P_ ((void));
-void init_baud_rate P_ ((void));
+int tabs_safe_p P_ ((int));
+void init_baud_rate P_ ((int));
void init_sigio P_ ((int));
/* Defined in xfaces.c */
void recompute_basic_faces P_ ((struct frame *));
int face_at_buffer_position P_ ((struct window *, int, int, int, int *,
int, int));
+int face_for_overlay_string P_ ((struct window *, int, int,
+ int, int *,
+ int, int, Lisp_Object));
int face_at_string_position P_ ((struct window *, Lisp_Object, int, int, int,
int, int *, enum face_id, int));
int merge_faces P_ ((struct frame *, Lisp_Object, int, int));
void prepare_desired_row P_ ((struct glyph_row *));
int line_hash_code P_ ((struct glyph_row *));
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));
extern Lisp_Object Qredisplay_dont_pause;
GLYPH spec_glyph_lookup_face P_ ((struct window *, GLYPH));
-/* Defined in term.c */
+/* Defined in terminal.c */
-extern void ring_bell P_ ((void));
-extern void set_terminal_modes P_ ((void));
-extern void reset_terminal_modes P_ ((void));
+extern void ring_bell P_ ((struct frame *));
extern void update_begin P_ ((struct frame *));
extern void update_end P_ ((struct frame *));
-extern void set_terminal_window P_ ((int));
-extern void set_scroll_region P_ ((int, int));
-extern void turn_off_insert P_ ((void));
-extern void turn_off_highlight P_ ((void));
-extern void background_highlight P_ ((void));
-extern void clear_frame P_ ((void));
-extern void clear_end_of_line P_ ((int));
-extern void clear_end_of_line_raw P_ ((int));
-extern void delete_glyphs P_ ((int));
-extern void ins_del_lines P_ ((int, int));
+extern void set_terminal_window P_ ((struct frame *, int));
+extern void cursor_to P_ ((struct frame *, int, int));
+extern void raw_cursor_to P_ ((struct frame *, int, int));
+extern void clear_to_end P_ ((struct frame *));
+extern void clear_frame P_ ((struct frame *));
+extern void clear_end_of_line P_ ((struct frame *, int));
+extern void write_glyphs P_ ((struct frame *, struct glyph *, int));
+extern void insert_glyphs P_ ((struct frame *, struct glyph *, int));
+extern void delete_glyphs P_ ((struct frame *, int));
+extern void ins_del_lines P_ ((struct frame *, int, int));
+
+extern struct terminal *init_initial_terminal P_ ((void));
+
+
+/* Defined in term.c */
+
+extern void tty_set_terminal_modes P_ ((struct terminal *));
+extern void tty_reset_terminal_modes P_ ((struct terminal *));
+extern void tty_turn_off_insert P_ ((struct tty_display_info *));
+extern void tty_turn_off_highlight P_ ((struct tty_display_info *));
extern int string_cost P_ ((char *));
extern int per_line_cost P_ ((char *));
extern void calculate_costs P_ ((struct frame *));
+extern void produce_glyphs P_ ((struct it *));
+extern void produce_special_glyphs P_ ((struct it *, enum display_element_type));
+extern int tty_capable_p P_ ((struct tty_display_info *, unsigned, unsigned long, unsigned long));
extern void set_tty_color_mode P_ ((struct frame *, Lisp_Object));
-extern void tty_setup_colors P_ ((int));
-extern void term_init P_ ((char *));
-void cursor_to P_ ((int, int));
-extern int tty_capable_p P_ ((struct frame *, unsigned, unsigned long, unsigned long));
+extern struct terminal *get_tty_terminal P_ ((Lisp_Object, int));
+extern struct terminal *get_named_tty P_ ((char *));
+EXFUN (Ftty_type, 1);
+extern void create_tty_output P_ ((struct frame *));
+extern struct terminal *init_tty P_ ((char *, char *, int));
+
/* Defined in scroll.c */