]> code.delx.au - gnu-emacs/blob - src/dispextern.h
Change all references from point to PT.
[gnu-emacs] / src / dispextern.h
1 /* Interface definitions for display code.
2 Copyright (C) 1985, 1993, 1994 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, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */
20
21 #ifndef _DISPEXTERN_H_
22 #define _DISPEXTERN_H_
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 #endif
31
32 #ifdef MSDOS
33 #include "msdos.h"
34 #endif
35
36 #ifdef HAVE_NTGUI
37 #include "win32.h"
38 #endif
39
40 #ifdef HAVE_FACES
41 struct face
42 {
43 /* If this is non-zero, it is a GC we can use without modification
44 to represent this face. */
45 GC gc;
46
47 /* Pixel value for foreground color. */
48 EMACS_UINT foreground;
49
50 /* Pixel value for background color. */
51 EMACS_UINT background;
52
53 /* Font used for this face. */
54 XFontStruct *font;
55
56 /* Background stipple or bitmap used for this face. */
57 Pixmap stipple;
58
59 /* Pixmap_depth. */
60 unsigned int pixmap_w, pixmap_h;
61
62 /* Whether or not to underline text in this face. */
63 char underline;
64 };
65
66 /* Let's stop using this and get rid of it. */
67 typedef struct face *FACE;
68
69 #define NORMAL_FACE ((struct face *) 0)
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
79 #else /* not HAVE_FACES */
80
81 typedef 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)
90
91 #endif /* not HAVE_FACES */
92
93
94 /* This structure is used for the actual display of text on a frame.
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
98 from buffers being displayed. */
99
100 struct frame_glyphs
101 {
102 struct frame *frame; /* Frame these glyphs belong to. */
103 int height;
104 int width;
105
106 /* Contents of the frame.
107 glyphs[V][H] is the glyph at position V, H.
108 Note that glyphs[V][-1],
109 glyphs[V][used[V]],
110 and glyphs[V][frame_width] are always '\0'. */
111 GLYPH **glyphs;
112 /* long vector from which the strings in `glyphs' are taken. */
113 GLYPH *total_contents;
114
115 /* When representing a desired frame,
116 enable[n] == 0 means that line n is same as current frame.
117 Between updates, all lines should be disabled.
118 When representing current frame contents,
119 enable[n] == 0 means that line n is blank. */
120 char *enable;
121
122 /* Everything on line n after column used[n] is considered blank. */
123 int *used;
124
125 /* highlight[n] != 0 iff line n is highlighted. */
126 char *highlight;
127
128 /* Buffer offset of this line's first char.
129 This is not really implemented, and cannot be,
130 and should be deleted. */
131 int *bufp;
132
133 #ifdef HAVE_WINDOW_SYSTEM
134 /* Pixel position of top left corner of line. */
135 short *top_left_x;
136 short *top_left_y;
137
138 /* Pixel width of line. */
139 short *pix_width;
140
141 /* Pixel height of line. */
142 short *pix_height;
143
144 /* Largest font ascent on this line. */
145 short *max_ascent;
146 #endif /* HAVE_WINDOW_SYSTEM */
147
148 /* Mapping of coordinate pairs to buffer positions.
149 This field holds a vector indexed by row number.
150 Its elements are vectors indexed by column number.
151 Each element of these vectors is a buffer position, 0, or -1.
152
153 For a column where the image of a text character starts,
154 the element value is the buffer position of that character.
155 When a window's screen line starts in mid character,
156 the element for the line's first column (at the window's left margin)
157 is that character's position.
158 For successive columns within a multicolumn character,
159 the element is -1.
160 For the column just beyond the last glyph on a line,
161 the element is the buffer position of the end of the line.
162 For following columns within the same window, the element is 0.
163 For rows past the end of the accessible buffer text,
164 the window's first column has ZV and other columns have 0.
165
166 Mode lines and vertical separator lines have 0.
167
168 The column of a window's left margin
169 always has a positive value (a buffer position), not 0 or -1,
170 for each line in that window's interior. */
171
172 int **charstarts;
173
174 /* This holds all the space in the subvectors of the charstarts field. */
175 int *total_charstarts;
176 };
177
178 extern void get_display_line ();
179 extern Lisp_Object sit_for ();
180
181 #endif /* not _DISPEXTERN_H_ */