(strftime.o): New target.
[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
18the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
19
c22ca93b
JB
20/* Nonzero means last display completed and cursor is really at
21 cursX, cursY. Zero means it was preempted. */
22extern int display_completed;
23
24#ifdef HAVE_X_WINDOWS
9f2279ad
JA
25#include <X11/Xlib.h>
26
27struct face
28 {
29 /* If this is non-zero, it is a GC we can use without modification
42087301 30 to represent this face. */
9f2279ad 31 GC gc;
88fd275e
JB
32
33 /* If we have ever called get_cached_face on this face structure,
34 here is the index in face_vector of the face it returned. It
35 might not be valid any more, but it's a good place to start
36 looking; get_cached_face tries to use this to avoid searching
37 all of face_vector. */
38 int cached_index;
9f2279ad 39
42087301 40 /* Pixel value for foreground color. */
0246d165 41 EMACS_UINT foreground;
9f2279ad 42
42087301 43 /* Pixel value for background color. */
0246d165 44 EMACS_UINT background;
9f2279ad 45
42087301
RS
46 /* Font used for this face. */
47 XFontStruct *font;
9f2279ad 48
42087301 49 /* Background stipple or bitmap used for this face. */
9f2279ad 50 Pixmap stipple;
42087301
RS
51
52 /* Pixmap_depth. */
53 unsigned int pixmap_w, pixmap_h;
9f2279ad 54
42087301 55 /* Whether or not to underline text in this face. */
9f2279ad
JA
56 char underline;
57 };
58
42087301 59/* Let's stop using this and get rid of it. */
9f2279ad
JA
60typedef struct face *FACE;
61
42087301 62#define NORMAL_FACE ((struct face *) 0)
9f2279ad
JA
63
64#define FACE_HAS_GC(f) ((f)->gc)
65#define FACE_GC(f) ((f)->gc)
66#define FACE_FOREGROUND(f) ((f)->foreground)
67#define FACE_BACKGROUND(f) ((f)->background)
68#define FACE_FONT(f) ((f)->font)
69#define FACE_STIPPLE(f) ((f)->stipple)
70#define FACE_UNDERLINE_P(f) ((f)->underline)
71
72#else /* Not X */
73
74typedef int FACE;
75
76#define NORMAL_FACE 0x0
77#define HIGHLIGHT_FACE 0x1
78#define UNDERLINE_FACE 0x2
79#define HIGHLIGHT_UNDERLINE_FACE 0x3
80
81#define FACE_HIGHLIGHT(f) ((f) & 0x1)
82#define FACE_UNDERLINE(f) ((f) & 0x2)
83#endif /* Not X */
84
c22ca93b 85
502b9b64 86/* This structure is used for the actual display of text on a frame.
c22ca93b
JB
87
88 There are two instantiations of it: the glyphs currently displayed,
89 and the glyphs we desire to display. The latter object is generated
42087301 90 from buffers being displayed. */
c22ca93b 91
502b9b64 92struct frame_glyphs
c22ca93b 93 {
502b9b64 94#ifdef MULTI_FRAME
42087301 95 struct frame *frame; /* Frame these glyphs belong to. */
502b9b64 96#endif /* MULTI_FRAME */
c22ca93b
JB
97 int height;
98 int width;
99
502b9b64 100 /* Contents of the frame.
265a9e55
JB
101 glyphs[V][H] is the glyph at position V, H.
102 Note that glyphs[V][-1],
103 glyphs[V][used[V]],
502b9b64 104 and glyphs[V][frame_width] are always '\0'. */
c22ca93b
JB
105 GLYPH **glyphs;
106 /* long vector from which the strings in `glyphs' are taken. */
107 GLYPH *total_contents;
108
502b9b64
JB
109 /* When representing a desired frame,
110 enable[n] == 0 means that line n is same as current frame.
8f607ef0 111 Between updates, all lines should be disabled.
502b9b64 112 When representing current frame contents,
265a9e55
JB
113 enable[n] == 0 means that line n is blank. */
114 char *enable;
115
116 /* Everything on line n after column used[n] is considered blank. */
117 int *used;
118
c22ca93b
JB
119 /* highlight[n] != 0 iff line n is highlighted. */
120 char *highlight;
121
0b20d257
RS
122 /* Buffer offset of this line's first char.
123 This is not really implemented, and cannot be,
124 and should be deleted. */
c22ca93b
JB
125 int *bufp;
126
127#ifdef HAVE_X_WINDOWS
42087301 128 /* Pixel position of top left corner of line. */
9f2279ad 129 short *top_left_x;
c22ca93b 130 short *top_left_y;
c22ca93b 131
42087301 132 /* Pixel width of line. */
9f2279ad
JA
133 short *pix_width;
134
42087301 135 /* Pixel height of line. */
9f2279ad 136 short *pix_height;
c22ca93b 137
42087301 138 /* Largest font ascent on this line. */
9f2279ad
JA
139 short *max_ascent;
140#endif /* HAVE_X_WINDOWS */
b741d9b1 141
0b20d257
RS
142 /* Mapping of coordinate pairs to buffer positions.
143 This field holds a vector indexed by row number.
144 Its elements are vectors indexed by column number.
145 Each element of these vectors is a buffer position, 0, or -1.
146
147 For a column where the image of a text character starts,
148 the element value is the buffer position of that character.
149 When a window's screen line starts in mid character,
150 the element for the line's first column (at the window's left margin)
151 is that character's position.
152 For successive columns within a multicolumn character,
153 the element is -1.
154 For the column just beyond the last glyph on a line,
155 the element is the buffer position of the end of the line.
156 For following columns within the same window, the element is 0.
157 For rows past the end of the accessible buffer text,
158 the window's first column has ZV and other columns have 0.
159
160 Mode lines and vertical separator lines have 0.
161
162 The column of a window's left margin
163 always has a positive value (a buffer position), not 0 or -1,
164 for each line in that window's interior. */
165
b741d9b1
RS
166 int **charstarts;
167
168 /* This holds all the space in the subvectors of the charstarts field. */
169 int *total_charstarts;
9f2279ad 170 };
c22ca93b
JB
171
172extern void get_display_line ();
bf34ebcf 173extern Lisp_Object sit_for ();