* dispextern.h (sit_for): Declare this extern.
[bpt/emacs.git] / src / dispextern.h
1 /* Interface definitions for display code.
2 Copyright (C) 1985, 1992 Free Software Foundation, Inc.
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
8 the Free Software Foundation; either version 2, or (at your option)
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
20 /* Nonzero means don't assume anything about current
21 contents of actual terminal frame */
22 extern int frame_garbaged;
23
24 /* Nonzero means last display completed and cursor is really at
25 cursX, cursY. Zero means it was preempted. */
26 extern int display_completed;
27
28 #ifdef HAVE_X_WINDOWS
29 #include <X11/Xlib.h>
30
31 struct face
32 {
33 /* If this is non-zero, it is a GC we can use without modification
34 to represent this face. */
35 GC gc;
36
37 /* Pixel value for foreground color. */
38 int foreground;
39
40 /* Pixel value for background color. */
41 int background;
42
43 /* Font used for this face */
44 XFontStruct font;
45
46 /* Background stipple or bitmap used for this face. */
47 Pixmap stipple;
48
49 /* Whether or not to underline text in this face. */
50 char underline;
51 };
52
53 typedef struct face *FACE;
54
55 #define NORMAL_FACE ((FACE *) 0)
56
57 #define FACE_HAS_GC(f) ((f)->gc)
58 #define FACE_GC(f) ((f)->gc)
59 #define FACE_FOREGROUND(f) ((f)->foreground)
60 #define FACE_BACKGROUND(f) ((f)->background)
61 #define FACE_FONT(f) ((f)->font)
62 #define FACE_STIPPLE(f) ((f)->stipple)
63 #define FACE_UNDERLINE_P(f) ((f)->underline)
64
65 #else /* Not X */
66
67 typedef int FACE;
68
69 #define NORMAL_FACE 0x0
70 #define HIGHLIGHT_FACE 0x1
71 #define UNDERLINE_FACE 0x2
72 #define HIGHLIGHT_UNDERLINE_FACE 0x3
73
74 #define FACE_HIGHLIGHT(f) ((f) & 0x1)
75 #define FACE_UNDERLINE(f) ((f) & 0x2)
76 #endif /* Not X */
77
78
79 /* This structure is used for the actual display of text on a frame.
80
81 There are two instantiations of it: the glyphs currently displayed,
82 and the glyphs we desire to display. The latter object is generated
83 from buffers being displayed. */
84
85 struct frame_glyphs
86 {
87 #ifdef MULTI_FRAME
88 struct frame *frame; /* Frame these glyphs belong to. */
89 #endif /* MULTI_FRAME */
90 int height;
91 int width;
92
93 /* Contents of the frame.
94 glyphs[V][H] is the glyph at position V, H.
95 Note that glyphs[V][-1],
96 glyphs[V][used[V]],
97 and glyphs[V][frame_width] are always '\0'. */
98 GLYPH **glyphs;
99 /* long vector from which the strings in `glyphs' are taken. */
100 GLYPH *total_contents;
101
102 /* When representing a desired frame,
103 enable[n] == 0 means that line n is same as current frame.
104 When representing current frame contents,
105 enable[n] == 0 means that line n is blank. */
106 char *enable;
107
108 /* Everything on line n after column used[n] is considered blank. */
109 int *used;
110
111 /* highlight[n] != 0 iff line n is highlighted. */
112 char *highlight;
113
114 /* Buffer offset of this line's first char. */
115 int *bufp;
116
117 #ifdef HAVE_X_WINDOWS
118 /* Pixel position of top left corner of line. */
119 short *top_left_x;
120 short *top_left_y;
121
122 /* Pixel width of line. */
123 short *pix_width;
124
125 /* Pixel height of line. */
126 short *pix_height;
127
128 /* Largest font ascent on this line. */
129 short *max_ascent;
130 #endif /* HAVE_X_WINDOWS */
131 };
132
133 extern void get_display_line ();
134 extern Lisp_Object sit_for ();