(Qforeground_color, Qbackground_color): Declare.
[bpt/emacs.git] / src / dispextern.h
CommitLineData
c22ca93b 1/* Interface definitions for display code.
3a22ee35 2 Copyright (C) 1985, 1993, 1994 Free Software Foundation, Inc.
c22ca93b
JB
3
4This file is part of GNU Emacs.
5
6GNU Emacs is free software; you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published by
e5d77022 8the Free Software Foundation; either version 2, or (at your option)
c22ca93b
JB
9any later version.
10
11GNU Emacs is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along with GNU Emacs; see the file COPYING. If not, write to
3b7ad313
EN
18the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19Boston, MA 02111-1307, USA. */
c22ca93b 20
87485d6f
MW
21#ifndef _DISPEXTERN_H_
22#define _DISPEXTERN_H_
23
c22ca93b
JB
24/* Nonzero means last display completed and cursor is really at
25 cursX, cursY. Zero means it was preempted. */
26extern int display_completed;
27
28#ifdef HAVE_X_WINDOWS
9f2279ad 29#include <X11/Xlib.h>
87485d6f
MW
30#endif
31
32#ifdef MSDOS
33#include "msdos.h"
34#endif
9f2279ad 35
497fbd42 36#ifdef HAVE_NTGUI
c0ac470c 37#include "w32gui.h"
497fbd42
GV
38#endif
39
87485d6f 40#ifdef HAVE_FACES
9f2279ad
JA
41struct face
42 {
43 /* If this is non-zero, it is a GC we can use without modification
dfbb1e90 44 to represent this face. Used only for ASCII characters. */
9f2279ad 45 GC gc;
dfbb1e90
KH
46
47 /* GC used for non-ASCII characters. */
48 GC non_ascii_gc;
49
42087301 50 /* Pixel value for foreground color. */
0246d165 51 EMACS_UINT foreground;
9f2279ad 52
42087301 53 /* Pixel value for background color. */
0246d165 54 EMACS_UINT background;
9f2279ad 55
dfbb1e90
KH
56 /* Font used for this face. If any fontset is set for this face,
57 this points to a `font' slot of the struct `font_info' for an
58 ASCII font of the fontset. In that case, we should not call
59 XFreeFont on it because the font may still be used somewhere
60 else. */
42087301 61 XFontStruct *font;
dfbb1e90
KH
62
63 /* Fontset ID if any fontset is set for this face, else -1. */
64 int fontset;
9f2279ad 65
42087301 66 /* Background stipple or bitmap used for this face. */
9f2279ad 67 Pixmap stipple;
42087301
RS
68
69 /* Pixmap_depth. */
70 unsigned int pixmap_w, pixmap_h;
9f2279ad 71
42087301 72 /* Whether or not to underline text in this face. */
9f2279ad
JA
73 char underline;
74 };
75
42087301 76/* Let's stop using this and get rid of it. */
9f2279ad
JA
77typedef struct face *FACE;
78
42087301 79#define NORMAL_FACE ((struct face *) 0)
9f2279ad
JA
80
81#define FACE_HAS_GC(f) ((f)->gc)
82#define FACE_GC(f) ((f)->gc)
dfbb1e90 83#define FACE_NON_ASCII_GC(f) ((f)->non_ascii_gc)
9f2279ad
JA
84#define FACE_FOREGROUND(f) ((f)->foreground)
85#define FACE_BACKGROUND(f) ((f)->background)
86#define FACE_FONT(f) ((f)->font)
dfbb1e90 87#define FACE_FONTSET(f) ((f)->fontset)
9f2279ad
JA
88#define FACE_STIPPLE(f) ((f)->stipple)
89#define FACE_UNDERLINE_P(f) ((f)->underline)
90
87485d6f 91#else /* not HAVE_FACES */
9f2279ad
JA
92
93typedef int FACE;
94
95#define NORMAL_FACE 0x0
96#define HIGHLIGHT_FACE 0x1
97#define UNDERLINE_FACE 0x2
98#define HIGHLIGHT_UNDERLINE_FACE 0x3
99
100#define FACE_HIGHLIGHT(f) ((f) & 0x1)
101#define FACE_UNDERLINE(f) ((f) & 0x2)
87485d6f
MW
102
103#endif /* not HAVE_FACES */
9f2279ad 104
c22ca93b 105
502b9b64 106/* This structure is used for the actual display of text on a frame.
c22ca93b
JB
107
108 There are two instantiations of it: the glyphs currently displayed,
109 and the glyphs we desire to display. The latter object is generated
42087301 110 from buffers being displayed. */
c22ca93b 111
502b9b64 112struct frame_glyphs
c22ca93b 113 {
42087301 114 struct frame *frame; /* Frame these glyphs belong to. */
c22ca93b
JB
115 int height;
116 int width;
117
502b9b64 118 /* Contents of the frame.
265a9e55
JB
119 glyphs[V][H] is the glyph at position V, H.
120 Note that glyphs[V][-1],
121 glyphs[V][used[V]],
502b9b64 122 and glyphs[V][frame_width] are always '\0'. */
c22ca93b
JB
123 GLYPH **glyphs;
124 /* long vector from which the strings in `glyphs' are taken. */
125 GLYPH *total_contents;
126
502b9b64
JB
127 /* When representing a desired frame,
128 enable[n] == 0 means that line n is same as current frame.
8f607ef0 129 Between updates, all lines should be disabled.
502b9b64 130 When representing current frame contents,
265a9e55
JB
131 enable[n] == 0 means that line n is blank. */
132 char *enable;
133
134 /* Everything on line n after column used[n] is considered blank. */
135 int *used;
136
c22ca93b
JB
137 /* highlight[n] != 0 iff line n is highlighted. */
138 char *highlight;
139
0b20d257
RS
140 /* Buffer offset of this line's first char.
141 This is not really implemented, and cannot be,
142 and should be deleted. */
c22ca93b
JB
143 int *bufp;
144
497fbd42 145#ifdef HAVE_WINDOW_SYSTEM
42087301 146 /* Pixel position of top left corner of line. */
9f2279ad 147 short *top_left_x;
c22ca93b 148 short *top_left_y;
c22ca93b 149
42087301 150 /* Pixel width of line. */
9f2279ad
JA
151 short *pix_width;
152
42087301 153 /* Pixel height of line. */
9f2279ad 154 short *pix_height;
c22ca93b 155
42087301 156 /* Largest font ascent on this line. */
9f2279ad 157 short *max_ascent;
497fbd42 158#endif /* HAVE_WINDOW_SYSTEM */
b741d9b1 159
0b20d257
RS
160 /* Mapping of coordinate pairs to buffer positions.
161 This field holds a vector indexed by row number.
162 Its elements are vectors indexed by column number.
163 Each element of these vectors is a buffer position, 0, or -1.
164
165 For a column where the image of a text character starts,
166 the element value is the buffer position of that character.
167 When a window's screen line starts in mid character,
168 the element for the line's first column (at the window's left margin)
169 is that character's position.
170 For successive columns within a multicolumn character,
171 the element is -1.
172 For the column just beyond the last glyph on a line,
173 the element is the buffer position of the end of the line.
174 For following columns within the same window, the element is 0.
175 For rows past the end of the accessible buffer text,
176 the window's first column has ZV and other columns have 0.
177
178 Mode lines and vertical separator lines have 0.
179
180 The column of a window's left margin
181 always has a positive value (a buffer position), not 0 or -1,
182 for each line in that window's interior. */
183
b741d9b1
RS
184 int **charstarts;
185
186 /* This holds all the space in the subvectors of the charstarts field. */
187 int *total_charstarts;
9f2279ad 188 };
c22ca93b 189
ec5d8db7
AS
190extern void redraw_frame P_ ((struct frame *));
191extern void redraw_garbaged_frames P_ ((void));
192extern void free_frame_glyphs P_ ((struct frame *, struct frame_glyphs *));
193extern void remake_frame_glyphs P_ ((struct frame *));
194extern void cancel_line P_ ((int, struct frame *));
195extern void clear_frame_records P_ ((struct frame *));
196extern void init_desired_glyphs P_ ((struct frame *));
197extern void get_display_line P_ ((struct frame *, int, int));
198extern int scroll_frame_lines P_ ((struct frame *, int, int, int, int));
199extern void preserve_other_columns P_ ((struct window *));
200extern void adjust_window_charstarts P_ ((struct window *, int, int));
201extern void verify_charstarts P_ ((struct window *));
202extern void cancel_my_columns P_ ((struct window *));
203extern int direct_output_for_insert P_ ((int));
204extern int direct_output_forward_char P_ ((int));
205extern int update_frame P_ ((struct frame *, int, int));
206extern void quit_error_check P_ ((void));
207extern int scrolling P_ ((struct frame *));
208extern int buffer_posn_from_coords P_ ((struct window *, int, int));
209extern void do_pending_window_change P_ ((void));
210extern void change_frame_size P_ ((struct frame *, int, int, int, int));
211extern void bitch_at_user P_ ((void));
212
213/* Defined in term.c */
214extern void ring_bell P_ ((void));
215extern void set_terminal_modes P_ ((void));
216extern void reset_terminal_modes P_ ((void));
217extern void update_begin P_ ((struct frame *));
218extern void update_end P_ ((struct frame *));
219extern void set_terminal_window P_ ((int));
220extern void set_scroll_region P_ ((int, int));
221extern void turn_off_insert P_ ((void));
222extern void turn_off_highlight P_ ((void));
223extern void background_highlight P_ ((void));
224extern void reassert_line_highlight P_ ((int, int));
225extern void change_line_highlight P_ ((int, int, int));
226extern void cursor_to P_ ((int, int));
227extern void clear_frame P_ ((void));
228extern void clear_end_of_line P_ ((int));
229extern void clear_end_of_line_raw P_ ((int));
230extern void write_glyphs P_ ((GLYPH *, int));
231extern void insert_glyphs P_ ((GLYPH *, int));
232extern void delete_glyphs P_ ((int));
233extern void ins_del_lines P_ ((int, int));
234extern int string_cost P_ ((char *));
235extern int per_line_cost P_ ((char *));
236extern void calculate_costs P_ ((struct frame *));
237extern void term_init P_ ((char *));
238extern void fatal P_ ((/* char *, ... */));
239
240/* Defined in scroll.c */
241extern int scrolling_max_lines_saved P_ ((int, int, int *, int *, int *));
242extern int scroll_cost P_ ((struct frame *, int, int, int));
243extern void do_line_insertion_deletion_costs P_ ((struct frame *, char *,
244 char *, char *, char *,
245 char *, char *, int));
87485d6f
MW
246
247#endif /* not _DISPEXTERN_H_ */