247
|
1 /* Interface definitions for display code.
|
7307
|
2 Copyright (C) 1985, 1993, 1994 Free Software Foundation, Inc.
|
247
|
3
|
|
4 This file is part of GNU Emacs.
|
|
5
|
|
6 GNU Emacs is free software; you can redistribute it and/or modify
|
|
7 it under the terms of the GNU General Public License as published by
|
732
|
8 the Free Software Foundation; either version 2, or (at your option)
|
247
|
9 any later version.
|
|
10
|
|
11 GNU Emacs is distributed in the hope that it will be useful,
|
|
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14 GNU General Public License for more details.
|
|
15
|
|
16 You should have received a copy of the GNU General Public License
|
|
17 along with GNU Emacs; see the file COPYING. If not, write to
|
|
18 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
|
19
|
9572
|
20 #ifndef _DISPEXTERN_H_
|
|
21 #define _DISPEXTERN_H_
|
|
22
|
247
|
23 /* Nonzero means last display completed and cursor is really at
|
|
24 cursX, cursY. Zero means it was preempted. */
|
|
25 extern int display_completed;
|
|
26
|
|
27 #ifdef HAVE_X_WINDOWS
|
1409
|
28 #include <X11/Xlib.h>
|
9572
|
29 #endif
|
1409
|
30
|
9572
|
31 #ifdef MSDOS
|
|
32 #include "msdos.h"
|
|
33 #endif
|
|
34
|
|
35 #ifdef HAVE_FACES
|
1409
|
36 struct face
|
|
37 {
|
|
38 /* If this is non-zero, it is a GC we can use without modification
|
2395
|
39 to represent this face. */
|
1409
|
40 GC gc;
|
|
41
|
2395
|
42 /* Pixel value for foreground color. */
|
8821
|
43 EMACS_UINT foreground;
|
1409
|
44
|
2395
|
45 /* Pixel value for background color. */
|
8821
|
46 EMACS_UINT background;
|
1409
|
47
|
2395
|
48 /* Font used for this face. */
|
|
49 XFontStruct *font;
|
1409
|
50
|
2395
|
51 /* Background stipple or bitmap used for this face. */
|
1409
|
52 Pixmap stipple;
|
2395
|
53
|
|
54 /* Pixmap_depth. */
|
|
55 unsigned int pixmap_w, pixmap_h;
|
1409
|
56
|
2395
|
57 /* Whether or not to underline text in this face. */
|
1409
|
58 char underline;
|
|
59 };
|
|
60
|
2395
|
61 /* Let's stop using this and get rid of it. */
|
1409
|
62 typedef struct face *FACE;
|
|
63
|
2395
|
64 #define NORMAL_FACE ((struct face *) 0)
|
1409
|
65
|
|
66 #define FACE_HAS_GC(f) ((f)->gc)
|
|
67 #define FACE_GC(f) ((f)->gc)
|
|
68 #define FACE_FOREGROUND(f) ((f)->foreground)
|
|
69 #define FACE_BACKGROUND(f) ((f)->background)
|
|
70 #define FACE_FONT(f) ((f)->font)
|
|
71 #define FACE_STIPPLE(f) ((f)->stipple)
|
|
72 #define FACE_UNDERLINE_P(f) ((f)->underline)
|
|
73
|
9572
|
74 #else /* not HAVE_FACES */
|
1409
|
75
|
|
76 typedef int FACE;
|
|
77
|
|
78 #define NORMAL_FACE 0x0
|
|
79 #define HIGHLIGHT_FACE 0x1
|
|
80 #define UNDERLINE_FACE 0x2
|
|
81 #define HIGHLIGHT_UNDERLINE_FACE 0x3
|
|
82
|
|
83 #define FACE_HIGHLIGHT(f) ((f) & 0x1)
|
|
84 #define FACE_UNDERLINE(f) ((f) & 0x2)
|
9572
|
85
|
|
86 #endif /* not HAVE_FACES */
|
1409
|
87
|
247
|
88
|
764
|
89 /* This structure is used for the actual display of text on a frame.
|
247
|
90
|
|
91 There are two instantiations of it: the glyphs currently displayed,
|
|
92 and the glyphs we desire to display. The latter object is generated
|
2395
|
93 from buffers being displayed. */
|
247
|
94
|
764
|
95 struct frame_glyphs
|
247
|
96 {
|
764
|
97 #ifdef MULTI_FRAME
|
2395
|
98 struct frame *frame; /* Frame these glyphs belong to. */
|
764
|
99 #endif /* MULTI_FRAME */
|
247
|
100 int height;
|
|
101 int width;
|
|
102
|
764
|
103 /* Contents of the frame.
|
485
|
104 glyphs[V][H] is the glyph at position V, H.
|
|
105 Note that glyphs[V][-1],
|
|
106 glyphs[V][used[V]],
|
764
|
107 and glyphs[V][frame_width] are always '\0'. */
|
247
|
108 GLYPH **glyphs;
|
|
109 /* long vector from which the strings in `glyphs' are taken. */
|
|
110 GLYPH *total_contents;
|
|
111
|
764
|
112 /* When representing a desired frame,
|
|
113 enable[n] == 0 means that line n is same as current frame.
|
1649
|
114 Between updates, all lines should be disabled.
|
764
|
115 When representing current frame contents,
|
485
|
116 enable[n] == 0 means that line n is blank. */
|
|
117 char *enable;
|
|
118
|
|
119 /* Everything on line n after column used[n] is considered blank. */
|
|
120 int *used;
|
|
121
|
247
|
122 /* highlight[n] != 0 iff line n is highlighted. */
|
|
123 char *highlight;
|
|
124
|
6658
|
125 /* Buffer offset of this line's first char.
|
|
126 This is not really implemented, and cannot be,
|
|
127 and should be deleted. */
|
247
|
128 int *bufp;
|
|
129
|
|
130 #ifdef HAVE_X_WINDOWS
|
2395
|
131 /* Pixel position of top left corner of line. */
|
1409
|
132 short *top_left_x;
|
247
|
133 short *top_left_y;
|
1409
|
134
|
2395
|
135 /* Pixel width of line. */
|
1409
|
136 short *pix_width;
|
|
137
|
2395
|
138 /* Pixel height of line. */
|
1409
|
139 short *pix_height;
|
|
140
|
2395
|
141 /* Largest font ascent on this line. */
|
1409
|
142 short *max_ascent;
|
247
|
143 #endif /* HAVE_X_WINDOWS */
|
6570
2c6d3ba470bb
(struct frame_glyphs): New fields charstarts and total_charstarts.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
144
|
6658
|
145 /* Mapping of coordinate pairs to buffer positions.
|
|
146 This field holds a vector indexed by row number.
|
|
147 Its elements are vectors indexed by column number.
|
|
148 Each element of these vectors is a buffer position, 0, or -1.
|
|
149
|
|
150 For a column where the image of a text character starts,
|
|
151 the element value is the buffer position of that character.
|
|
152 When a window's screen line starts in mid character,
|
|
153 the element for the line's first column (at the window's left margin)
|
|
154 is that character's position.
|
|
155 For successive columns within a multicolumn character,
|
|
156 the element is -1.
|
|
157 For the column just beyond the last glyph on a line,
|
|
158 the element is the buffer position of the end of the line.
|
|
159 For following columns within the same window, the element is 0.
|
|
160 For rows past the end of the accessible buffer text,
|
|
161 the window's first column has ZV and other columns have 0.
|
|
162
|
|
163 Mode lines and vertical separator lines have 0.
|
|
164
|
|
165 The column of a window's left margin
|
|
166 always has a positive value (a buffer position), not 0 or -1,
|
|
167 for each line in that window's interior. */
|
|
168
|
6570
2c6d3ba470bb
(struct frame_glyphs): New fields charstarts and total_charstarts.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
169 int **charstarts;
|
2c6d3ba470bb
(struct frame_glyphs): New fields charstarts and total_charstarts.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
170
|
2c6d3ba470bb
(struct frame_glyphs): New fields charstarts and total_charstarts.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
171 /* This holds all the space in the subvectors of the charstarts field. */
|
2c6d3ba470bb
(struct frame_glyphs): New fields charstarts and total_charstarts.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
172 int *total_charstarts;
|
247
|
173 };
|
|
174
|
|
175 extern void get_display_line ();
|
1510
|
176 extern Lisp_Object sit_for ();
|
9572
|
177
|
|
178 #endif /* not _DISPEXTERN_H_ */
|