Update FSF's address in the preamble.
[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
GV
36#ifdef HAVE_NTGUI
37#include "win32.h"
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
42087301 44 to represent this face. */
9f2279ad
JA
45 GC gc;
46
42087301 47 /* Pixel value for foreground color. */
0246d165 48 EMACS_UINT foreground;
9f2279ad 49
42087301 50 /* Pixel value for background color. */
0246d165 51 EMACS_UINT background;
9f2279ad 52
42087301
RS
53 /* Font used for this face. */
54 XFontStruct *font;
9f2279ad 55
42087301 56 /* Background stipple or bitmap used for this face. */
9f2279ad 57 Pixmap stipple;
42087301
RS
58
59 /* Pixmap_depth. */
60 unsigned int pixmap_w, pixmap_h;
9f2279ad 61
42087301 62 /* Whether or not to underline text in this face. */
9f2279ad
JA
63 char underline;
64 };
65
42087301 66/* Let's stop using this and get rid of it. */
9f2279ad
JA
67typedef struct face *FACE;
68
42087301 69#define NORMAL_FACE ((struct face *) 0)
9f2279ad
JA
70
71#define FACE_HAS_GC(f) ((f)->gc)
72#define FACE_GC(f) ((f)->gc)
73#define FACE_FOREGROUND(f) ((f)->foreground)
74#define FACE_BACKGROUND(f) ((f)->background)
75#define FACE_FONT(f) ((f)->font)
76#define FACE_STIPPLE(f) ((f)->stipple)
77#define FACE_UNDERLINE_P(f) ((f)->underline)
78
87485d6f 79#else /* not HAVE_FACES */
9f2279ad
JA
80
81typedef int FACE;
82
83#define NORMAL_FACE 0x0
84#define HIGHLIGHT_FACE 0x1
85#define UNDERLINE_FACE 0x2
86#define HIGHLIGHT_UNDERLINE_FACE 0x3
87
88#define FACE_HIGHLIGHT(f) ((f) & 0x1)
89#define FACE_UNDERLINE(f) ((f) & 0x2)
87485d6f
MW
90
91#endif /* not HAVE_FACES */
9f2279ad 92
c22ca93b 93
502b9b64 94/* This structure is used for the actual display of text on a frame.
c22ca93b
JB
95
96 There are two instantiations of it: the glyphs currently displayed,
97 and the glyphs we desire to display. The latter object is generated
42087301 98 from buffers being displayed. */
c22ca93b 99
502b9b64 100struct frame_glyphs
c22ca93b 101 {
502b9b64 102#ifdef MULTI_FRAME
42087301 103 struct frame *frame; /* Frame these glyphs belong to. */
502b9b64 104#endif /* MULTI_FRAME */
c22ca93b
JB
105 int height;
106 int width;
107
502b9b64 108 /* Contents of the frame.
265a9e55
JB
109 glyphs[V][H] is the glyph at position V, H.
110 Note that glyphs[V][-1],
111 glyphs[V][used[V]],
502b9b64 112 and glyphs[V][frame_width] are always '\0'. */
c22ca93b
JB
113 GLYPH **glyphs;
114 /* long vector from which the strings in `glyphs' are taken. */
115 GLYPH *total_contents;
116
502b9b64
JB
117 /* When representing a desired frame,
118 enable[n] == 0 means that line n is same as current frame.
8f607ef0 119 Between updates, all lines should be disabled.
502b9b64 120 When representing current frame contents,
265a9e55
JB
121 enable[n] == 0 means that line n is blank. */
122 char *enable;
123
124 /* Everything on line n after column used[n] is considered blank. */
125 int *used;
126
c22ca93b
JB
127 /* highlight[n] != 0 iff line n is highlighted. */
128 char *highlight;
129
0b20d257
RS
130 /* Buffer offset of this line's first char.
131 This is not really implemented, and cannot be,
132 and should be deleted. */
c22ca93b
JB
133 int *bufp;
134
497fbd42 135#ifdef HAVE_WINDOW_SYSTEM
42087301 136 /* Pixel position of top left corner of line. */
9f2279ad 137 short *top_left_x;
c22ca93b 138 short *top_left_y;
c22ca93b 139
42087301 140 /* Pixel width of line. */
9f2279ad
JA
141 short *pix_width;
142
42087301 143 /* Pixel height of line. */
9f2279ad 144 short *pix_height;
c22ca93b 145
42087301 146 /* Largest font ascent on this line. */
9f2279ad 147 short *max_ascent;
497fbd42 148#endif /* HAVE_WINDOW_SYSTEM */
b741d9b1 149
0b20d257
RS
150 /* Mapping of coordinate pairs to buffer positions.
151 This field holds a vector indexed by row number.
152 Its elements are vectors indexed by column number.
153 Each element of these vectors is a buffer position, 0, or -1.
154
155 For a column where the image of a text character starts,
156 the element value is the buffer position of that character.
157 When a window's screen line starts in mid character,
158 the element for the line's first column (at the window's left margin)
159 is that character's position.
160 For successive columns within a multicolumn character,
161 the element is -1.
162 For the column just beyond the last glyph on a line,
163 the element is the buffer position of the end of the line.
164 For following columns within the same window, the element is 0.
165 For rows past the end of the accessible buffer text,
166 the window's first column has ZV and other columns have 0.
167
168 Mode lines and vertical separator lines have 0.
169
170 The column of a window's left margin
171 always has a positive value (a buffer position), not 0 or -1,
172 for each line in that window's interior. */
173
b741d9b1
RS
174 int **charstarts;
175
176 /* This holds all the space in the subvectors of the charstarts field. */
177 int *total_charstarts;
9f2279ad 178 };
c22ca93b
JB
179
180extern void get_display_line ();
bf34ebcf 181extern Lisp_Object sit_for ();
87485d6f
MW
182
183#endif /* not _DISPEXTERN_H_ */