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