annotate src/redisplay-output.c @ 388:aabb7f5b1c81 r21-2-9

Import from CVS: tag r21-2-9
author cvs
date Mon, 13 Aug 2007 11:09:42 +0200
parents bbff43aa5eb7
children 74fd4e045ea6
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 /* Synchronize redisplay structures and output changes.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2 Copyright (C) 1994, 1995 Board of Trustees, University of Illinois.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3 Copyright (C) 1995, 1996 Ben Wing.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4 Copyright (C) 1996 Chuck Thompson.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 This file is part of XEmacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8 XEmacs is free software; you can redistribute it and/or modify it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9 under the terms of the GNU General Public License as published by the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 Free Software Foundation; either version 2, or (at your option) any
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 later version.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 XEmacs is distributed in the hope that it will be useful, but WITHOUT
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 for more details.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 You should have received a copy of the GNU General Public License
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 along with XEmacs; see the file COPYING. If not, write to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 Boston, MA 02111-1307, USA. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23 /* Synched up with: Not in FSF. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25 /* This file has been Mule-ized. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27 /* Author: Chuck Thompson */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29 #include <config.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 #include "lisp.h"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32 #include "buffer.h"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 #include "window.h"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 #include "frame.h"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 #include "device.h"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36 #include "glyphs.h"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 #include "redisplay.h"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 #include "faces.h"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 static int compare_runes (struct window *w, struct rune *crb,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 struct rune *drb);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 static void redraw_cursor_in_window (struct window *w,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 int run_end_begin_glyphs);
388
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
44 static void redisplay_output_display_block (struct window *w, struct display_line *dl,
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
45 int block, int start, int end, int start_pixpos,
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
46 int cursor_start, int cursor_width,
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
47 int cursor_height);
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 /*****************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 sync_rune_structs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 Synchronize the given rune blocks.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 ****************************************************************************/
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 static void
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 sync_rune_structs (struct window *w, rune_dynarr *cra, rune_dynarr *dra)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 int rune_elt;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 int max_move = ((Dynarr_length (dra) > Dynarr_largest (cra))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 ? Dynarr_largest (cra)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 : Dynarr_length (dra));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 if (max_move)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 /* #### Doing this directly breaks the encapsulation. But, the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 running time of this function has a measurable impact on
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 redisplay performance so avoiding all excess overhead is a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 good thing. Is all of this true? */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 memcpy (cra->base, dra->base, sizeof (struct rune) * max_move);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 Dynarr_set_size (cra, max_move);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 Dynarr_reset (cra);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 for (rune_elt = max_move; rune_elt < Dynarr_length (dra); rune_elt++)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 struct rune rb, *crb;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77 struct rune *drb = Dynarr_atp (dra, rune_elt);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 crb = &rb;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 memcpy (crb, drb, sizeof (struct rune));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81 Dynarr_add (cra, *crb);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85 /*****************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 sync_display_line_structs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 For the given LINE in window W, make the current display line equal
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 the desired display line.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 ****************************************************************************/
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91 static void
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92 sync_display_line_structs (struct window *w, int line, int do_blocks,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93 display_line_dynarr *cdla,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94 display_line_dynarr *ddla)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96 int cdla_len = Dynarr_length (cdla);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98 struct display_line dl, *clp, *dlp;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99 int db_elt;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101 dlp = Dynarr_atp (ddla, line);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102 if (line >= Dynarr_largest (cdla))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104 clp = &dl;
185
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 116
diff changeset
105 clp->display_blocks = Dynarr_new (display_block);
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107 else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109 clp = Dynarr_atp (cdla, line);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110 if (clp->display_blocks)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111 Dynarr_reset (clp->display_blocks);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112 if (clp->left_glyphs)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114 Dynarr_free (clp->left_glyphs);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115 clp->left_glyphs = 0;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117 if (clp->right_glyphs)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119 Dynarr_free (clp->right_glyphs);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120 clp->right_glyphs = 0;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
123 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124 display_block_dynarr *tdb = clp->display_blocks;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126 memcpy (clp, dlp, sizeof (struct display_line));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
127 clp->display_blocks = tdb;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128 clp->left_glyphs = 0;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
129 clp->right_glyphs = 0;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132 if (!do_blocks && line >= cdla_len)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
133 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
134 Dynarr_add (cdla, *clp);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
135 return;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
136 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
137
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
138 for (db_elt = 0; db_elt < Dynarr_length (dlp->display_blocks); db_elt++)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
140 struct display_block db, *cdb;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
141 struct display_block *ddb = Dynarr_atp (dlp->display_blocks, db_elt);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
142
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
143 if (db_elt >= Dynarr_largest (clp->display_blocks))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
145 cdb = &db;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
146 memcpy (cdb, ddb, sizeof (struct display_block));
185
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 116
diff changeset
147 cdb->runes = Dynarr_new (rune);
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
148 Dynarr_add (clp->display_blocks, *cdb);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
150 else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
151 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
152 rune_dynarr *tr;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
153
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
154 cdb = Dynarr_atp (clp->display_blocks, db_elt);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
155 tr = cdb->runes;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
156 memcpy (cdb, ddb, sizeof (struct display_block));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157 cdb->runes = tr;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
158 Dynarr_increment (clp->display_blocks);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
159 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
160
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
161 sync_rune_structs (w, cdb->runes, ddb->runes);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
162 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
163
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
164 if (line >= cdla_len)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
165 Dynarr_add (cdla, *clp);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
166 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
167
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
168 /*****************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
169 compare_runes
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
170
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
171 Compare to runes to see if each of their fields is equal. If so,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
172 return true otherwise return false.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
173 ****************************************************************************/
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
174 static int
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
175 compare_runes (struct window *w, struct rune *crb, struct rune *drb)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
176 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
177 /* Do not compare the values of bufpos and endpos. They do not
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
178 affect the display characteristics. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
179
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
180 if ((crb->findex != drb->findex) ||
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
181 (WINDOW_FACE_CACHEL_DIRTY (w, drb->findex)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
182 return 0;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
183 else if (crb->xpos != drb->xpos)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
184 return 0;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
185 else if (crb->width != drb->width)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
186 return 0;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
187 else if (crb->cursor_type != drb->cursor_type)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
188 return 0;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
189 else if (crb->type != drb->type)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
190 return 0;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
191 else if (crb->type == RUNE_CHAR &&
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
192 (crb->object.chr.ch != drb->object.chr.ch))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
193 return 0;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
194 else if (crb->type == RUNE_DGLYPH &&
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
195 (!EQ (crb->object.dglyph.glyph, drb->object.dglyph.glyph) ||
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
196 !EQ (crb->object.dglyph.extent, drb->object.dglyph.extent) ||
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
197 crb->object.dglyph.xoffset != drb->object.dglyph.xoffset))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
198 return 0;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
199 else if (crb->type == RUNE_HLINE &&
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
200 (crb->object.hline.thickness != drb->object.hline.thickness ||
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
201 crb->object.hline.yoffset != drb->object.hline.yoffset))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
202 return 0;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
203 else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
204 return 1;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
205 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
206
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
207 /*****************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
208 get_next_display_block
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
209
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
210 Return the next display starting at or overlapping START_POS. Return
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
211 the start of the next region in NEXT_START.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
212 ****************************************************************************/
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
213 int
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
214 get_next_display_block (layout_bounds bounds, display_block_dynarr *dba,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
215 int start_pos, int *next_start)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
216 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
217 int next_display_block = NO_BLOCK;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
218 int priority = -1;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
219 int block;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
220
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
221 /* If we don't find a display block covering or starting at
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
222 start_pos, then we return the starting point of the next display
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
223 block or the next division boundary, whichever is closer to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
224 start_pos. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
225 if (next_start)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
226 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
227 if (start_pos >= bounds.left_out && start_pos < bounds.left_in)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
228 *next_start = bounds.left_in;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
229 else if (start_pos < bounds.left_white)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
230 *next_start = bounds.left_white;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
231 else if (start_pos < bounds.right_white)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
232 *next_start = bounds.right_white;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
233 else if (start_pos < bounds.right_in)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
234 *next_start = bounds.right_in;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
235 else if (start_pos <= bounds.right_out)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
236 *next_start = bounds.right_out;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
237 else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
238 abort ();
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
239 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
240
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
241 for (block = 0; block < Dynarr_length (dba); block++)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
242 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
243 struct display_block *db = Dynarr_atp (dba, block);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
244
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
245 if (db->start_pos <= start_pos && db->end_pos > start_pos)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
246 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
247 if ((int) db->type > priority)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
248 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
249 priority = db->type;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
250 next_display_block = block;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
251 if (next_start)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
252 *next_start = db->end_pos;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
253 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
254 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
255 else if (next_start && db->start_pos > start_pos)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
256 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
257 if (db->start_pos < *next_start)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
258 *next_start = db->start_pos;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
259 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
260 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
261
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
262 return next_display_block;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
263 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
264
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
265 /*****************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
266 get_cursor_size_and_location
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
267
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
268 Return the information defining the pixel location of the cursor.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
269 ****************************************************************************/
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
270 static void
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
271 get_cursor_size_and_location (struct window *w, struct display_block *db,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
272 int cursor_location,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
273 int *cursor_start, int *cursor_width,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
274 int *cursor_height)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
275 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
276 struct rune *rb;
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 269
diff changeset
277 Lisp_Object window;
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
278 int defheight, defwidth;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
279
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
280 if (Dynarr_length (db->runes) <= cursor_location)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
281 abort ();
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
282
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
283 XSETWINDOW (window, w);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
284
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
285 rb = Dynarr_atp (db->runes, cursor_location);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
286 *cursor_start = rb->xpos;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
287
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
288 default_face_height_and_width (window, &defheight, &defwidth);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
289 *cursor_height = defheight;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
290
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
291 if (rb->type == RUNE_BLANK)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
292 *cursor_width = defwidth;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
293 else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
294 *cursor_width = rb->width;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
295 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
296
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
297 /*****************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
298 compare_display_blocks
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
299
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
300 Given two display blocks, output only those areas where they differ.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
301 ****************************************************************************/
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
302 static int
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
303 compare_display_blocks (struct window *w, struct display_line *cdl,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
304 struct display_line *ddl, int c_block, int d_block,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
305 int start_pixpos, int cursor_start, int cursor_width,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
306 int cursor_height)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
307 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
308 struct frame *f = XFRAME (w->frame);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
309 struct display_block *cdb, *ddb;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
310 int start_pos;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
311 int stop_pos;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
312 int force = 0;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
313 int block_end;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
314
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
315 cdb = Dynarr_atp (cdl->display_blocks, c_block);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
316 ddb = Dynarr_atp (ddl->display_blocks, d_block);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
317
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
318 assert (cdb->type == ddb->type);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
319
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
320 start_pos = -1;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
321 stop_pos = min (Dynarr_length (cdb->runes), Dynarr_length (ddb->runes));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
322
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
323 block_end =
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
324 (!Dynarr_length (ddb->runes)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
325 ? 0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
326 : (Dynarr_atp (ddb->runes, Dynarr_length (ddb->runes) - 1)->xpos +
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
327 Dynarr_atp (ddb->runes, Dynarr_length (ddb->runes) - 1)->width));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
328
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
329 /* If the new block type is not text and the cursor status is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
330 changing and it overlaps the position of this block then force a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
331 full redraw of the block in order to make sure that the cursor is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
332 updated properly. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
333 if (ddb->type != TEXT
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 82
diff changeset
334 #if 0
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 82
diff changeset
335 /* I'm not sure exactly what this code wants to do, but it's
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 82
diff changeset
336 * not right--it doesn't update when cursor_elt changes from, e.g.,
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 82
diff changeset
337 * 0 to 8, and the new or old cursor loc overlaps this block.
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 82
diff changeset
338 * I've replaced it with the more conservative test below.
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 82
diff changeset
339 * -dkindred@cs.cmu.edu 23-Mar-1997 */
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
340 && ((cdl->cursor_elt == -1 && ddl->cursor_elt != -1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
341 || (cdl->cursor_elt != -1 && ddl->cursor_elt == -1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
342 && (ddl->cursor_elt == -1 ||
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
343 (cursor_start
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
344 && cursor_width
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
345 && (cursor_start + cursor_width) >= start_pixpos
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 82
diff changeset
346 && cursor_start <= block_end))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 82
diff changeset
347 #else
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 82
diff changeset
348 && (cdl->cursor_elt != ddl->cursor_elt)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 82
diff changeset
349 #endif
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 82
diff changeset
350 )
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
351 force = 1;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
352
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
353 if (f->windows_structure_changed ||
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
354 f->faces_changed ||
269
b2472a1930f2 Import from CVS: tag r20-5b33
cvs
parents: 267
diff changeset
355 f->glyphs_changed ||
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
356 cdl->ypos != ddl->ypos ||
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
357 cdl->ascent != ddl->ascent ||
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
358 cdl->descent != ddl->descent ||
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
359 cdl->clip != ddl->clip ||
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
360 force)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
361 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
362 start_pos = 0;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
363 force = 1;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
364 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
365 else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
366 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
367 int elt = 0;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
368
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
369 while (start_pos < 0 && elt < stop_pos)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
370 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
371 if (!compare_runes (w, Dynarr_atp (cdb->runes, elt),
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
372 Dynarr_atp (ddb->runes, elt)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
373 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
374 start_pos = elt;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
375 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
376 else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
377 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
378 elt++;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
379 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
380 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
381
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
382 /* If nothing has changed in the area where the blocks overlap, but
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
383 there are new blocks in the desired block, then adjust the start
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
384 point accordingly. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
385 if (elt == stop_pos && stop_pos < Dynarr_length (ddb->runes))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
386 start_pos = stop_pos;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
387 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
388
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
389 if (start_pos >= 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
390 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
391 if ((Dynarr_length (ddb->runes) != Dynarr_length (cdb->runes))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
392 || force)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
393 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
394 stop_pos = Dynarr_length (ddb->runes);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
395 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
396 else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
397 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
398 /* If the lines have the same number of runes and we are not
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
399 forcing a full redraw because the display line has
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
400 changed position then we try and optimize how much of the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
401 line we actually redraw by scanning backwards from the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
402 end for the first changed rune. This optimization is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
403 almost always triggered by face changes. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
404
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
405 int elt = Dynarr_length (ddb->runes) - 1;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
406
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
407 while (elt > start_pos)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
408 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
409 if (!compare_runes (w, Dynarr_atp (cdb->runes, elt),
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
410 Dynarr_atp (ddb->runes, elt)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
411 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
412 else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
413 elt--;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
414 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
415 stop_pos = elt + 1;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
416 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
417
388
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
418 redisplay_output_display_block (w, ddl, d_block, start_pos,
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
419 stop_pos, start_pixpos,
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
420 cursor_start, cursor_width,
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
421 cursor_height);
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
422 return 1;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
423 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
424
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
425 return 0;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
426 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
427
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
428 /*****************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
429 clear_left_border
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
430
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
431 Clear the lefthand outside border.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
432 ****************************************************************************/
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
433 static void
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
434 clear_left_border (struct window *w, int y, int height)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
435 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
436 struct frame *f = XFRAME (w->frame);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
437 Lisp_Object window;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
438
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
439 XSETWINDOW (window, w);
384
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
440 redisplay_clear_region (window, DEFAULT_INDEX,
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
441 FRAME_LEFT_BORDER_START (f), y,
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
442 FRAME_BORDER_WIDTH (f), height);
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
443 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
444
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
445 /*****************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
446 clear_right_border
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
447
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
448 Clear the righthand outside border.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
449 ****************************************************************************/
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
450 static void
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
451 clear_right_border (struct window *w, int y, int height)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
452 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
453 struct frame *f = XFRAME (w->frame);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
454 Lisp_Object window;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
455
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
456 XSETWINDOW (window, w);
384
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
457 redisplay_clear_region (window, DEFAULT_INDEX,
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
458 FRAME_RIGHT_BORDER_START (f),
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
459 y, FRAME_BORDER_WIDTH (f), height);
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
460 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
461
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
462 /*****************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
463 output_display_line
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
464
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
465 Ensure that the contents of the given display line is correct
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
466 on-screen. The force_ parameters are used by redisplay_move_cursor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
467 to correctly update cursor locations and only cursor locations.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
468 ****************************************************************************/
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
469 void
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
470 output_display_line (struct window *w, display_line_dynarr *cdla,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
471 display_line_dynarr *ddla, int line, int force_start,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
472 int force_end)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
473
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
474 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
475 struct frame *f = XFRAME (w->frame);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
476 struct buffer *b = XBUFFER (w->buffer);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
477 struct buffer *old_b = window_display_buffer (w);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
478 struct display_line *cdl, *ddl;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
479 display_block_dynarr *cdba, *ddba;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
480 int start_pixpos, end_pixpos;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
481 int cursor_start, cursor_width, cursor_height;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
482
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
483 int force = (force_start >= 0 || force_end >= 0);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
484 int clear_border = 0;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
485 int must_sync = 0;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
486
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
487 if (cdla && line < Dynarr_length (cdla))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
488 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
489 cdl = Dynarr_atp (cdla, line);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
490 cdba = cdl->display_blocks;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
491 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
492 else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
493 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
494 cdl = NULL;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
495 cdba = NULL;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
496 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
497
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
498 ddl = Dynarr_atp (ddla, line); /* assert line < Dynarr_length (ddla) */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
499 ddba = ddl->display_blocks;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
500
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
501 if (force_start >= 0 && force_start >= ddl->bounds.left_out)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
502 start_pixpos = force_start;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
503 else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
504 start_pixpos = ddl->bounds.left_out;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
505
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
506 if (force_end >= 0 && force_end < ddl->bounds.right_out)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
507 end_pixpos = force_end;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
508 else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
509 end_pixpos = ddl->bounds.right_out;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
510
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
511 /* Get the cursor parameters. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
512 if (ddl->cursor_elt != -1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
513 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
514 struct display_block *db;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
515
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
516 /* If the lines cursor parameter is not -1 then it indicates
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
517 which rune in the TEXT block contains the cursor. This means
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
518 that there must be at least one display block. The TEXT
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
519 block, if present, must always be the first display block. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
520 assert (Dynarr_length (ddba) != 0);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
521
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
522 db = Dynarr_atp (ddba, 0);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
523 assert (db->type == TEXT);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
524
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
525 get_cursor_size_and_location (w, db, ddl->cursor_elt, &cursor_start,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
526 &cursor_width, &cursor_height);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
527 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
528 else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
529 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
530 cursor_start = cursor_width = cursor_height = 0;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
531 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
532
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
533 /* The modeline should only have a single block and it had better be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
534 a TEXT block. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
535 if (ddl->modeline)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
536 {
380
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 282
diff changeset
537 /* The shadow thickness check is necessary if only the sign of
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
538 the size changed. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
539 if (cdba && !w->shadow_thickness_changed)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
540 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
541 must_sync |= compare_display_blocks (w, cdl, ddl, 0, 0,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
542 start_pixpos, 0, 0, 0);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
543 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
544 else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
545 {
388
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
546 redisplay_output_display_block (w, ddl, 0, 0, -1, start_pixpos,
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
547 0, 0, 0);
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
548 must_sync = 1;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
549 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
550
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
551 if (must_sync)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
552 clear_border = 1;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
553 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
554
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
555 while (!ddl->modeline && start_pixpos < end_pixpos)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
556 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
557 int block;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
558 int next_start_pixpos;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
559
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
560 block = get_next_display_block (ddl->bounds, ddba, start_pixpos,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
561 &next_start_pixpos);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
562
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
563 /* If we didn't find a block then we should blank the area
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
564 between start_pos and next_start if necessary. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
565 if (block == NO_BLOCK)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
566 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
567 /* We only erase those areas which were actually previously
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
568 covered by a display block unless the window structure
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
569 changed. In that case we clear all areas since the current
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
570 structures may actually represent a different buffer. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
571 while (start_pixpos < next_start_pixpos)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
572 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
573 int block_end;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
574 int old_block;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
575
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
576 if (cdba)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
577 old_block = get_next_display_block (ddl->bounds, cdba,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
578 start_pixpos, &block_end);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
579 else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
580 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
581 old_block = NO_BLOCK;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
582 block_end = next_start_pixpos;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
583 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
584
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
585 if (!cdba || old_block != NO_BLOCK || b != old_b ||
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
586 f->windows_structure_changed ||
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
587 f->faces_changed ||
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
588 force ||
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
589 (cdl && (cdl->ypos != ddl->ypos ||
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
590 cdl->ascent != ddl->ascent ||
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
591 cdl->descent != ddl->descent ||
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
592 cdl->clip != ddl->clip)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
593 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
594 int x, y, width, height;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
595 Lisp_Object face;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
596
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
597 must_sync = 1;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
598 x = start_pixpos;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
599 y = ddl->ypos - ddl->ascent;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
600 width = min (next_start_pixpos, block_end) - x;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
601 height = ddl->ascent + ddl->descent - ddl->clip;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
602
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
603 if (x < ddl->bounds.left_in)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
604 face = Vleft_margin_face;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
605 else if (x < ddl->bounds.right_in)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
606 face = Vdefault_face;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
607 else if (x < ddl->bounds.right_out)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
608 face = Vright_margin_face;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
609 else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
610 face = Qnil;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
611
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
612 if (!NILP (face))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
613 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
614 Lisp_Object window;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
615
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
616 XSETWINDOW (window, w);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
617
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
618 /* Clear the empty area. */
384
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
619 redisplay_clear_region (window, get_builtin_face_cache_index (w, face),
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
620 x, y, width, height);
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
621
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
622 /* Mark that we should clear the border. This is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
623 necessary because italic fonts may leave
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
624 droppings in the border. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
625 clear_border = 1;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
626 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
627 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
628
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
629 start_pixpos = min (next_start_pixpos, block_end);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
630 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
631 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
632 else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
633 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
634 struct display_block *cdb, *ddb;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
635 int block_end;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
636 int old_block;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
637
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
638 if (cdba)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
639 old_block = get_next_display_block (ddl->bounds, cdba,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
640 start_pixpos, &block_end);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
641 else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
642 old_block = NO_BLOCK;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
643
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
644 ddb = Dynarr_atp (ddba, block);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
645 cdb = (old_block != NO_BLOCK ? Dynarr_atp (cdba, old_block) : 0);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
646
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
647 /* If there was formerly no block over the current
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
648 region or if it was a block of a different type, then
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
649 output the entire ddb. Otherwise, compare cdb and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
650 ddb and output only the changed region. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
651 if (!force && cdb && ddb->type == cdb->type && b == old_b)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
652 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
653 must_sync |= compare_display_blocks (w, cdl, ddl, old_block,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
654 block, start_pixpos,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
655 cursor_start, cursor_width,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
656 cursor_height);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
657 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
658 else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
659 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
660 int elt;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
661 int first_elt = 0;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
662 int last_elt = -1;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
663
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
664 for (elt = 0; elt < Dynarr_length (ddb->runes); elt++)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
665 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
666 struct rune *rb = Dynarr_atp (ddb->runes, elt);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
667
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
668 if (start_pixpos >= rb->xpos
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
669 && start_pixpos < rb->xpos + rb->width)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
670 first_elt = elt;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
671
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
672 if (end_pixpos > rb->xpos
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
673 && end_pixpos <= rb->xpos + rb->width)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
674 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
675 last_elt = elt + 1;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
676 if (last_elt > Dynarr_length (ddb->runes))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
677 last_elt = Dynarr_length (ddb->runes);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
678 break;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
679 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
680 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
681
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
682 must_sync = 1;
388
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
683 redisplay_output_display_block (w, ddl, block, first_elt,
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
684 last_elt,
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
685 start_pixpos,
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
686 cursor_start, cursor_width,
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
687 cursor_height);
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
688 }
388
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
689
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
690 start_pixpos = next_start_pixpos;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
691 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
692 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
693
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
694 /* Clear the internal border if we are next to it and the window
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
695 structure or frame size has changed or if something caused
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
696 clear_border to be tripped. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
697 /* #### Doing this on f->clear sucks but is necessary because of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
698 window-local background values. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
699 if (f->windows_structure_changed || f->faces_changed || clear_border
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
700 || f->clear)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
701 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
702 int y = ddl->ypos - ddl->ascent;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
703 int height = ddl->ascent + ddl->descent - ddl->clip;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
704
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
705 if (ddl->modeline)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
706 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
707 y -= MODELINE_SHADOW_THICKNESS (w);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
708 height += (2 * MODELINE_SHADOW_THICKNESS (w));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
709 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
710
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
711 if (window_is_leftmost (w))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
712 clear_left_border (w, y, height);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
713 if (window_is_rightmost (w))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
714 clear_right_border (w, y, height);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
715 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
716
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
717 if (cdla)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
718 sync_display_line_structs (w, line, must_sync, cdla, ddla);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
719 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
720
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
721 /*****************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
722 redisplay_move_cursor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
723
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
724 For the given window W, move the cursor to NEW_POINT. Returns a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
725 boolean indicating success or failure.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
726 ****************************************************************************/
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
727
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
728 #define ADJ_BUFPOS (rb->bufpos + dl->offset)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
729 #define ADJ_ENDPOS (rb->endpos + dl->offset)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
730
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
731 int
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
732 redisplay_move_cursor (struct window *w, Bufpos new_point, int no_output_end)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
733 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
734 struct frame *f = XFRAME (w->frame);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
735 struct device *d = XDEVICE (f->device);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
736
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
737 display_line_dynarr *cla = window_display_lines (w, CURRENT_DISP);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
738 struct display_line *dl;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
739 struct display_block *db;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
740 struct rune *rb;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
741 int x = w->last_point_x[CURRENT_DISP];
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
742 int y = w->last_point_y[CURRENT_DISP];
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
743
263
727739f917cb Import from CVS: tag r20-5b30
cvs
parents: 209
diff changeset
744 /*
265
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents: 263
diff changeset
745 * Bail if cursor_in_echo_area is non-zero and we're fiddling with
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents: 263
diff changeset
746 * the cursor in a non-active minibuffer window, since that is a
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents: 263
diff changeset
747 * special case that is handled elsewhere and this function need
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents: 263
diff changeset
748 * not handle it. Return 1 so the caller will assume we
263
727739f917cb Import from CVS: tag r20-5b30
cvs
parents: 209
diff changeset
749 * succeeded.
727739f917cb Import from CVS: tag r20-5b30
cvs
parents: 209
diff changeset
750 */
265
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents: 263
diff changeset
751 if (cursor_in_echo_area && MINI_WINDOW_P (w) &&
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents: 263
diff changeset
752 w != XWINDOW (FRAME_SELECTED_WINDOW (f)))
263
727739f917cb Import from CVS: tag r20-5b30
cvs
parents: 209
diff changeset
753 return 1;
727739f917cb Import from CVS: tag r20-5b30
cvs
parents: 209
diff changeset
754
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
755 if (y < 0 || y >= Dynarr_length (cla))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
756 return 0;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
757
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
758 dl = Dynarr_atp (cla, y);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
759 db = get_display_block_from_line (dl, TEXT);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
760
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
761 if (x < 0 || x >= Dynarr_length (db->runes))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
762 return 0;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
763
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
764 rb = Dynarr_atp (db->runes, x);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
765
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
766 if (rb->cursor_type == CURSOR_OFF)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
767 return 0;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
768 else if (ADJ_BUFPOS == new_point
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
769 || (ADJ_ENDPOS && (new_point >= ADJ_BUFPOS)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
770 && (new_point <= ADJ_ENDPOS)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
771 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
772 w->last_point_x[CURRENT_DISP] = x;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
773 w->last_point_y[CURRENT_DISP] = y;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
774 Fset_marker (w->last_point[CURRENT_DISP], make_int (ADJ_BUFPOS),
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
775 w->buffer);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
776 dl->cursor_elt = x;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
777 return 1;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
778 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
779 else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
780 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
781 DEVMETH (d, output_begin, (d));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
782
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
783 /* #### This is a gross kludge. Cursor handling is such a royal
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
784 pain in the ass. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
785 if (rb->type == RUNE_DGLYPH &&
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
786 (EQ (rb->object.dglyph.glyph, Vtruncation_glyph) ||
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
787 EQ (rb->object.dglyph.glyph, Vcontinuation_glyph)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
788 rb->cursor_type = NO_CURSOR;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
789 else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
790 rb->cursor_type = CURSOR_OFF;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
791 dl->cursor_elt = -1;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
792 output_display_line (w, 0, cla, y, rb->xpos, rb->xpos + rb->width);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
793 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
794
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
795 w->last_point_x[CURRENT_DISP] = -1;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
796 w->last_point_y[CURRENT_DISP] = -1;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
797 Fset_marker (w->last_point[CURRENT_DISP], Qnil, w->buffer);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
798
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
799 /* If this isn't the selected frame, then erasing the old cursor is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
800 all we actually had to do. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
801 if (w != XWINDOW (FRAME_SELECTED_WINDOW (device_selected_frame (d))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
802 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
803 if (!no_output_end)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
804 DEVMETH (d, output_end, (d));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
805
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
806 return 1;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
807 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
808
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
809 /* This should only occur in the minibuffer. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
810 if (new_point == 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
811 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
812 w->last_point_x[CURRENT_DISP] = 0;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
813 w->last_point_y[CURRENT_DISP] = y;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
814 Fset_marker (w->last_point[CURRENT_DISP], Qzero, w->buffer);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
815
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
816 rb = Dynarr_atp (db->runes, 0);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
817 rb->cursor_type = CURSOR_ON;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
818 dl->cursor_elt = 0;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
819
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
820 output_display_line (w, 0, cla, y, rb->xpos, rb->xpos + rb->width);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
821
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
822 if (!no_output_end)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
823 DEVMETH (d, output_end, (d));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
824 return 1;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
825 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
826 else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
827 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
828 int cur_rb = 0;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
829 int first = 0;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
830 int cur_dl, up;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
831
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
832 if (ADJ_BUFPOS < new_point)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
833 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
834 up = 1;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
835 cur_rb = x + 1;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
836 cur_dl = y;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
837 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
838 else /* (rb->bufpos + dl->offset) > new_point */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
839 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
840 up = 0;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
841
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
842 if (!x)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
843 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
844 cur_dl = y - 1;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
845 first = 0;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
846 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
847 else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
848 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
849 cur_rb = x - 1;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
850 cur_dl = y;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
851 first = 1;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
852 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
853 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
854
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
855 while ((up ? (cur_dl < Dynarr_length (cla)) : (cur_dl >= 0)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
856 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
857 dl = Dynarr_atp (cla, cur_dl);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
858 db = get_display_block_from_line (dl, TEXT);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
859
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
860 if (!up && !first)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
861 cur_rb = Dynarr_length (db->runes) - 1;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
862
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
863 while ((!scroll_on_clipped_lines || !dl->clip) &&
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
864 (up ? (cur_rb < Dynarr_length (db->runes)) : (cur_rb >= 0)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
865 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
866 rb = Dynarr_atp (db->runes, cur_rb);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
867
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
868 if (rb->cursor_type != IGNORE_CURSOR
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
869 && rb->cursor_type != NO_CURSOR &&
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
870 (ADJ_BUFPOS == new_point
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
871 || (ADJ_ENDPOS && (new_point >= ADJ_BUFPOS)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
872 && (new_point <= ADJ_BUFPOS))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
873 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
874 rb->cursor_type = CURSOR_ON;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
875 dl->cursor_elt = cur_rb;
185
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 116
diff changeset
876
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
877
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
878 output_display_line (w, 0, cla, cur_dl, rb->xpos,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
879 rb->xpos + rb->width);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
880
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
881 w->last_point_x[CURRENT_DISP] = cur_rb;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
882 w->last_point_y[CURRENT_DISP] = cur_dl;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
883 Fset_marker (w->last_point[CURRENT_DISP],
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
884 make_int (ADJ_BUFPOS), w->buffer);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
885
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
886 if (!no_output_end)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
887 DEVMETH (d, output_end, (d));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
888 return 1;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
889 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
890
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
891 (up ? cur_rb++ : cur_rb--);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
892 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
893
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
894 (up ? (cur_rb = 0) : (first = 0));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
895 (up ? cur_dl++ : cur_dl--);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
896 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
897 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
898
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
899 if (!no_output_end)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
900 DEVMETH (d, output_end, (d));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
901 return 0;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
902 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
903 #undef ADJ_BUFPOS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
904 #undef ADJ_ENDPOS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
905
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
906 /*****************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
907 redraw_cursor_in_window
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
908
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
909 For the given window W, redraw the cursor if it is contained within
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
910 the window.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
911 ****************************************************************************/
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
912 static void
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
913 redraw_cursor_in_window (struct window *w, int run_end_begin_meths)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
914 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
915 struct frame *f = XFRAME (w->frame);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
916 struct device *d = XDEVICE (f->device);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
917
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
918 display_line_dynarr *dla = window_display_lines (w, CURRENT_DISP);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
919 struct display_line *dl;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
920 struct display_block *db;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
921 struct rune *rb;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
922
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
923 int x = w->last_point_x[CURRENT_DISP];
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
924 int y = w->last_point_y[CURRENT_DISP];
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
925
265
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents: 263
diff changeset
926 if (cursor_in_echo_area && MINI_WINDOW_P (w) &&
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents: 263
diff changeset
927 !echo_area_active (f) && minibuf_level == 0)
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents: 263
diff changeset
928 {
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents: 263
diff changeset
929 MAYBE_DEVMETH (d, set_final_cursor_coords, (f, w->pixel_top, 0));
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents: 263
diff changeset
930 }
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents: 263
diff changeset
931
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
932 if (y < 0 || y >= Dynarr_length (dla))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
933 return;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
934
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
935 if (MINI_WINDOW_P (w) && f != device_selected_frame (d) &&
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
936 !is_surrogate_for_selected_frame (f))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
937 return;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
938
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
939 dl = Dynarr_atp (dla, y);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
940 db = get_display_block_from_line (dl, TEXT);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
941
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
942 if (x < 0 || x >= Dynarr_length (db->runes))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
943 return;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
944
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
945 rb = Dynarr_atp (db->runes, x);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
946
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
947 /* Don't call the output routine if the block isn't actually the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
948 cursor. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
949 if (rb->cursor_type == CURSOR_ON)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
950 {
265
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents: 263
diff changeset
951 MAYBE_DEVMETH (d, set_final_cursor_coords,
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents: 263
diff changeset
952 (f, dl->ypos - 1, rb->xpos));
8efd647ea9ca Import from CVS: tag r20-5b31
cvs
parents: 263
diff changeset
953
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
954 if (run_end_begin_meths)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
955 DEVMETH (d, output_begin, (d));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
956
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
957 output_display_line (w, 0, dla, y, rb->xpos, rb->xpos + rb->width);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
958
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
959 if (run_end_begin_meths)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
960 DEVMETH (d, output_end, (d));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
961 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
962 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
963
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
964 /*****************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
965 redisplay_redraw_cursor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
966
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
967 For the given frame F, redraw the cursor on the selected window.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
968 This is used to update the cursor after focus changes.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
969 ****************************************************************************/
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
970 void
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
971 redisplay_redraw_cursor (struct frame *f, int run_end_begin_meths)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
972 {
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 269
diff changeset
973 Lisp_Object window;
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 269
diff changeset
974
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 269
diff changeset
975 if (!cursor_in_echo_area)
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 269
diff changeset
976 window = FRAME_SELECTED_WINDOW (f);
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 269
diff changeset
977 else if (FRAME_HAS_MINIBUF_P (f))
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 269
diff changeset
978 window = FRAME_MINIBUF_WINDOW (f);
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 269
diff changeset
979 else
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 269
diff changeset
980 return;
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 269
diff changeset
981
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 269
diff changeset
982 redraw_cursor_in_window (XWINDOW (window), run_end_begin_meths);
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
983 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
984
384
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
985 /****************************************************************************
388
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
986 redisplay_output_display_block
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
987
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
988 Given a display line, a block number for that start line, output all
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
989 runes between start and end in the specified display block.
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
990 ****************************************************************************/
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
991 static void
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
992 redisplay_output_display_block (struct window *w, struct display_line *dl, int block,
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
993 int start, int end, int start_pixpos, int cursor_start,
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
994 int cursor_width, int cursor_height)
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
995 {
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
996 struct frame *f = XFRAME (w->frame);
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
997 struct device *d = XDEVICE (f->device);
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
998
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
999 DEVMETH (d, output_display_block, (w, dl, block, start,
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
1000 end, start_pixpos,
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
1001 cursor_start, cursor_width,
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
1002 cursor_height));
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
1003 }
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
1004
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
1005 /****************************************************************************
384
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1006 redisplay_unmap_subwindows
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1007
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1008 Remove subwindows from the area in the box defined by the given
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1009 parameters.
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1010 ****************************************************************************/
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1011 static void redisplay_unmap_subwindows (struct frame* f, int x, int y, int width, int height)
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1012 {
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1013 int elt;
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1014
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1015 for (elt = 0; elt < Dynarr_length (f->subwindow_cachels); elt++)
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1016 {
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1017 struct subwindow_cachel *cachel =
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1018 Dynarr_atp (f->subwindow_cachels, elt);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1019
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1020 if (cachel->being_displayed
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1021 &&
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1022 cachel->x + cachel->width > x && cachel->x < x + width
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1023 &&
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1024 cachel->y + cachel->height > y && cachel->y < y + height)
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1025 {
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1026 unmap_subwindow (cachel->subwindow);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1027 }
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1028 }
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1029 }
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1030
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1031 /****************************************************************************
388
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
1032 redisplay_unmap_subwindows_maybe
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
1033
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
1034 Potentially subwindows from the area in the box defined by the given
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
1035 parameters.
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
1036 ****************************************************************************/
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
1037 void redisplay_unmap_subwindows_maybe (struct frame* f, int x, int y, int width, int height)
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
1038 {
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
1039 if (Dynarr_length (FRAME_SUBWINDOW_CACHE (f)))
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
1040 {
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
1041 redisplay_unmap_subwindows (f, x, y, width, height);
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
1042 }
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
1043 }
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
1044
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
1045 /****************************************************************************
384
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1046 redisplay_output_subwindow
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1047
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1048
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1049 output a subwindow. This code borrows heavily from the pixmap stuff,
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1050 although is much simpler not needing to account for partial
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1051 pixmaps, backgrounds etc.
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1052 ****************************************************************************/
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1053 void
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1054 redisplay_output_subwindow (struct window *w, struct display_line *dl,
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1055 Lisp_Object image_instance, int xpos, int xoffset,
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1056 int start_pixpos, int width, face_index findex,
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1057 int cursor_start, int cursor_width, int cursor_height)
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1058 {
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1059 struct Lisp_Image_Instance *p = XIMAGE_INSTANCE (image_instance);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1060 Lisp_Object window;
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1061
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1062 int lheight = dl->ascent + dl->descent - dl->clip;
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1063 int pheight = ((int) IMAGE_INSTANCE_SUBWINDOW_HEIGHT (p) > lheight ? lheight :
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1064 IMAGE_INSTANCE_SUBWINDOW_HEIGHT (p));
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1065
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1066 XSETWINDOW (window, w);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1067
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1068 /* Clear the area the subwindow is going into. The subwindow itself
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1069 will always take care of the full width. We don't want to clear
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1070 where it is going to go in order to avoid flicker. So, all we
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1071 have to take care of is any area above or below the subwindow. Of
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1072 course this is rubbish if the subwindow has transparent areas
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1073 (for instance with frames). */
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1074 /* #### We take a shortcut for now. We know that since we have
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1075 subwindow_offset hardwired to 0 that the subwindow is against the top
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1076 edge so all we have to worry about is below it. */
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1077 if ((int) (dl->ypos - dl->ascent + pheight) <
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1078 (int) (dl->ypos + dl->descent - dl->clip))
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1079 {
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1080 int clear_x, clear_width;
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1081
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1082 int clear_y = dl->ypos - dl->ascent + pheight;
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1083 int clear_height = lheight - pheight;
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1084
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1085 if (start_pixpos >= 0 && start_pixpos > xpos)
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1086 {
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1087 clear_x = start_pixpos;
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1088 clear_width = xpos + width - start_pixpos;
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1089 }
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1090 else
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1091 {
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1092 clear_x = xpos;
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1093 clear_width = width;
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1094 }
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1095
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1096 redisplay_clear_region (window, findex, clear_x, clear_y,
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1097 clear_width, clear_height);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1098 }
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1099 #if 0
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1100 redisplay_clear_region (window, findex, xpos - xoffset, dl->ypos - dl->ascent,
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1101 width, lheight);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1102 #endif
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1103 /* if we can't view the whole window we can't view any of it */
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1104 if (IMAGE_INSTANCE_SUBWINDOW_HEIGHT (p) > lheight
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1105 ||
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1106 IMAGE_INSTANCE_SUBWINDOW_WIDTH (p) > width)
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1107 {
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1108 redisplay_clear_region (window, findex, xpos - xoffset, dl->ypos - dl->ascent,
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1109 width, lheight);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1110 unmap_subwindow (image_instance);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1111 }
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1112 else
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1113 map_subwindow (image_instance, xpos - xoffset, dl->ypos - dl->ascent);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1114 }
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1115
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1116 /****************************************************************************
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1117 redisplay_clear_region
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1118
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1119 Clear the area in the box defined by the given parameters using the
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1120 given face. This has been generalised so that subwindows can be
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1121 coped with effectively.
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1122 ****************************************************************************/
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1123 void
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1124 redisplay_clear_region (Lisp_Object locale, face_index findex, int x, int y,
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1125 int width, int height)
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1126 {
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1127 struct window *w = NULL;
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1128 struct frame *f = NULL;
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1129 struct device *d;
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1130 Lisp_Object background_pixmap = Qunbound;
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1131 Lisp_Object fcolor = Qnil, bcolor = Qnil;
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1132
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1133 if (!width || !height)
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1134 return;
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1135
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1136 if (WINDOWP (locale))
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1137 {
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1138 w = XWINDOW (locale);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1139 f = XFRAME (w->frame);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1140 }
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1141 else if (FRAMEP (locale))
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1142 {
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1143 w = NULL;
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1144 f = XFRAME (locale);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1145 }
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1146 else
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1147 abort ();
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1148
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1149 d = XDEVICE (f->device);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1150
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1151 /* if we have subwindows in the region we have to unmap them */
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1152 if (Dynarr_length (FRAME_SUBWINDOW_CACHE (f)))
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1153 {
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1154 redisplay_unmap_subwindows (f, x, y, width, height);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1155 }
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1156
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1157 /* #### This isn't quite right for when this function is called
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1158 from the toolbar code. */
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1159
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1160 /* Don't use a backing pixmap in the border area */
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1161 if (x >= FRAME_LEFT_BORDER_END (f)
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1162 && x < FRAME_RIGHT_BORDER_START (f)
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1163 && y >= FRAME_TOP_BORDER_END (f)
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1164 && y < FRAME_BOTTOM_BORDER_START (f))
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1165 {
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1166 Lisp_Object temp;
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1167
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1168 if (w)
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1169 {
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1170 temp = WINDOW_FACE_CACHEL_BACKGROUND_PIXMAP (w, findex);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1171
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1172 if (IMAGE_INSTANCEP (temp)
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1173 && IMAGE_INSTANCE_PIXMAP_TYPE_P (XIMAGE_INSTANCE (temp)))
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1174 {
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1175 /* #### maybe we could implement such that a string
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1176 can be a background pixmap? */
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1177 background_pixmap = temp;
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1178 }
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1179 }
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1180 else
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1181 {
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1182 temp = FACE_BACKGROUND_PIXMAP (Vdefault_face, locale);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1183
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1184 if (IMAGE_INSTANCEP (temp)
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1185 && IMAGE_INSTANCE_PIXMAP_TYPE_P (XIMAGE_INSTANCE (temp)))
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1186 {
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1187 background_pixmap = temp;
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1188 }
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1189 }
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1190 }
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1191
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1192 if (!UNBOUNDP (background_pixmap) &&
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1193 XIMAGE_INSTANCE_PIXMAP_DEPTH (background_pixmap) == 0)
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1194 {
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1195 if (w)
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1196 {
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1197 fcolor = WINDOW_FACE_CACHEL_FOREGROUND (w, findex);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1198 bcolor = WINDOW_FACE_CACHEL_BACKGROUND (w, findex);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1199 }
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1200 else
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1201 {
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1202 fcolor = FACE_FOREGROUND (Vdefault_face, locale);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1203 bcolor = FACE_BACKGROUND (Vdefault_face, locale);
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1204 }
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1205 }
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1206 else
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1207 {
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1208 fcolor = (w ?
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1209 WINDOW_FACE_CACHEL_BACKGROUND (w, findex) :
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1210 FACE_BACKGROUND (Vdefault_face, locale));
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1211
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1212 }
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1213
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1214 if (UNBOUNDP (background_pixmap))
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1215 background_pixmap = Qnil;
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1216
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1217 DEVMETH (d, clear_region,
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1218 (locale, d, f, findex, x, y, width, height, fcolor, bcolor, background_pixmap));
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1219 }
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1220
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1221 /*****************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1222 redisplay_clear_top_of_window
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1223
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1224 If window is topmost, clear the internal border above it.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1225 ****************************************************************************/
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1226 static void
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1227 redisplay_clear_top_of_window (struct window *w)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1228 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1229 Lisp_Object window;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1230 XSETWINDOW (window, w);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1231
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1232 if (!NILP (Fwindow_highest_p (window)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1233 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1234 struct frame *f = XFRAME (w->frame);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1235 int x, y, width, height;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1236
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1237 x = w->pixel_left;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1238 width = w->pixel_width;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1239
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1240 if (window_is_leftmost (w))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1241 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1242 x -= FRAME_BORDER_WIDTH (f);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1243 width += FRAME_BORDER_WIDTH (f);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1244 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1245 if (window_is_rightmost (w))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1246 width += FRAME_BORDER_WIDTH (f);
185
3d6bfa290dbd Import from CVS: tag r20-3b19
cvs
parents: 116
diff changeset
1247
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1248 y = FRAME_TOP_BORDER_START (f) - 1;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1249 height = FRAME_BORDER_HEIGHT (f) + 1;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1250
384
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1251 redisplay_clear_region (window, DEFAULT_INDEX, x, y, width, height);
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1252 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1253 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1254
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1255 /*****************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1256 redisplay_clear_bottom_of_window
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1257
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1258 Clear window from right below the last display line to right above
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1259 the modeline. The calling function can limit the area actually
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1260 erased by setting min_start and/or max_end to positive values.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1261 ****************************************************************************/
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1262 void
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1263 redisplay_clear_bottom_of_window (struct window *w, display_line_dynarr *ddla,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1264 int min_start, int max_end)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1265 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1266 struct frame *f = XFRAME (w->frame);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1267 struct device *d = XDEVICE (f->device);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1268 int ypos1, ypos2;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1269 int ddla_len = Dynarr_length (ddla);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1270
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1271 ypos2 = WINDOW_TEXT_BOTTOM (w);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1272 #ifdef HAVE_SCROLLBARS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1273 /* This adjustment is to catch the intersection of any scrollbars. */
282
c42ec1d1cded Import from CVS: tag r21-0b39
cvs
parents: 272
diff changeset
1274 if (f->windows_structure_changed && NILP (w->scrollbar_on_top_p))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1275 ypos2 += window_scrollbar_height (w);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1276 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1277
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1278 if (ddla_len)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1279 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1280 if (ddla_len == 1 && Dynarr_atp (ddla, 0)->modeline)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1281 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1282 ypos1 = WINDOW_TEXT_TOP (w);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1283 #ifdef HAVE_SCROLLBARS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1284 /* This adjustment is to catch the intersection of any scrollbars. */
282
c42ec1d1cded Import from CVS: tag r21-0b39
cvs
parents: 272
diff changeset
1285 if (f->windows_structure_changed && !NILP (w->scrollbar_on_top_p))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1286 ypos1 -= window_scrollbar_height (w);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1287 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1288 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1289 else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1290 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1291 struct display_line *dl = Dynarr_atp (ddla, ddla_len - 1);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1292 ypos1 = dl->ypos + dl->descent - dl->clip;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1293 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1294 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1295 else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1296 ypos1 = WINDOW_TEXT_TOP (w);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1297
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1298 /* #### See if this can be made conditional on the frame
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1299 changing size. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1300 if (MINI_WINDOW_P (w))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1301 ypos2 += FRAME_BORDER_HEIGHT (f);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1302
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1303 if (min_start >= 0 && ypos1 < min_start)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1304 ypos1 = min_start;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1305 if (max_end >= 0 && ypos2 > max_end)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1306 ypos2 = max_end;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1307
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1308 if (ypos2 <= ypos1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1309 return;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1310
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1311 DEVMETH (d, clear_to_window_end, (w, ypos1, ypos2));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1312 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1313
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1314 /*****************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1315 redisplay_update_line
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1316
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1317 This is used during incremental updates to update a single line and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1318 correct the offsets on all lines below it. At the moment
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1319 update_values is false if we are only updating the modeline.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1320 ****************************************************************************/
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1321 void
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1322 redisplay_update_line (struct window *w, int first_line, int last_line,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1323 int update_values)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1324 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1325 struct frame *f = XFRAME (w->frame);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1326 struct device *d = XDEVICE (f->device);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1327
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1328 display_line_dynarr *cdla = window_display_lines (w, CURRENT_DISP);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1329 display_line_dynarr *ddla = window_display_lines (w, DESIRED_DISP);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1330
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1331 DEVMETH (d, output_begin, (d));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1332
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1333 while (first_line <= last_line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1334 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1335 Charcount old_len = (Dynarr_atp (cdla, first_line)->end_bufpos -
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1336 Dynarr_atp (cdla, first_line)->bufpos);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1337 Charcount new_len = (Dynarr_atp (ddla, first_line)->end_bufpos -
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1338 Dynarr_atp (ddla, first_line)->bufpos);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1339
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1340 assert (Dynarr_length (cdla) == Dynarr_length (ddla));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1341
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1342 /* Output the changes. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1343 output_display_line (w, cdla, ddla, first_line, -1, -1);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1344
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1345 /* Update the offsets. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1346 if (update_values)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1347 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1348 int cur_line = first_line + 1;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1349 while (cur_line < Dynarr_length (cdla))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1350 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1351 Dynarr_atp (cdla, cur_line)->offset += (new_len - old_len);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1352 Dynarr_atp (ddla, cur_line)->offset += (new_len - old_len);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1353 cur_line++;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1354 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1355 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1356
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1357 /* Update the window_end_pos and other settings. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1358 if (update_values)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1359 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1360 w->window_end_pos[CURRENT_DISP] -= (new_len - old_len);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1361
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1362 if (Dynarr_atp (ddla, first_line)->cursor_elt != -1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1363 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1364 w->last_point_x[CURRENT_DISP] = w->last_point_x[DESIRED_DISP];
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1365 w->last_point_y[CURRENT_DISP] = w->last_point_y[DESIRED_DISP];
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1366 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1367 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1368
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1369 first_line++;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1370 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1371
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1372 /* Update the window max line length. We have to scan the entire
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1373 set of display lines otherwise we might not detect if the max is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1374 supposed to shrink. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1375 if (update_values)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1376 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1377 int line = 0;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1378
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1379 w->max_line_len = 0;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1380 while (line < Dynarr_length (ddla))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1381 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1382 struct display_line *dl = Dynarr_atp (ddla, line);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1383
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1384 if (!dl->modeline)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1385 w->max_line_len = max (dl->num_chars, w->max_line_len);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1386
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1387 line++;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1388 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1389 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1390
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1391 w->last_modified[CURRENT_DISP] = w->last_modified[DESIRED_DISP];
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1392 w->last_facechange[CURRENT_DISP] = w->last_facechange[DESIRED_DISP];
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1393 Fset_marker (w->last_point[CURRENT_DISP],
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1394 Fmarker_position (w->last_point[DESIRED_DISP]), w->buffer);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1395 Fset_marker (w->last_start[CURRENT_DISP],
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1396 Fmarker_position (w->last_start[DESIRED_DISP]), w->buffer);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1397
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1398 /* We don't bother updating the vertical scrollbars here. This
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1399 gives us a performance increase while having minimal loss of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1400 quality to the scrollbar slider size and position since when this
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1401 function is called we know that the changes to the buffer were
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1402 very localized. We have to update the horizontal scrollbars,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1403 though, because this routine could cause a change which has a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1404 larger impact on their sizing. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1405 /* #### See if we can get away with only calling this if
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1406 max_line_len is greater than the window_char_width. */
209
41ff10fd062f Import from CVS: tag r20-4b3
cvs
parents: 185
diff changeset
1407 #if defined(HAVE_SCROLLBARS) && defined(HAVE_X_WINDOWS)
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 70
diff changeset
1408 {
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 70
diff changeset
1409 extern int stupid_vertical_scrollbar_drag_hack;
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 70
diff changeset
1410
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 70
diff changeset
1411 update_window_scrollbars (w, NULL, 1, stupid_vertical_scrollbar_drag_hack);
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 70
diff changeset
1412 stupid_vertical_scrollbar_drag_hack = 1;
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 70
diff changeset
1413 }
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1414 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1415
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1416 /* This has to be done after we've updated the values. We don't
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1417 call output_end for tty frames. Redisplay will do this after all
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1418 tty windows have been updated. This cuts down on cursor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1419 flicker. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1420 if (FRAME_TTY_P (f))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1421 redisplay_redraw_cursor (f, 0);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1422 else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1423 DEVMETH (d, output_end, (d));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1424 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1425
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1426 /*****************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1427 redisplay_output_window
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1428
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1429 For the given window W, ensure that the current display lines are
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1430 equal to the desired display lines, outputing changes as necessary.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1431
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1432 #### Fuck me. This just isn't going to cut it for tty's. The output
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1433 decisions for them must be based on the contents of the entire frame
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1434 because that is how the available output capabilities think. The
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1435 solution is relatively simple. Create redisplay_output_frame. This
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1436 will basically merge all of the separate window display structs into
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1437 a single one for the frame. This combination structure will be able
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1438 to be passed to the same output_display_line which works for windows
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1439 on X frames and the right things will happen. It just takes time to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1440 do.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1441 ****************************************************************************/
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1442 void
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1443 redisplay_output_window (struct window *w)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1444 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1445 struct frame *f = XFRAME (w->frame);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1446 struct device *d = XDEVICE (f->device);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1447
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1448 display_line_dynarr *cdla = window_display_lines (w, CURRENT_DISP);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1449 display_line_dynarr *ddla = window_display_lines (w, DESIRED_DISP);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1450
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1451 int cdla_len = Dynarr_length (cdla);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1452 int ddla_len = Dynarr_length (ddla);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1453
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1454 int line;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1455 int need_to_clear_bottom = 0;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1456 int need_to_clear_start = -1;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1457 int need_to_clear_end = -1;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1458
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1459 /* Backgrounds may have changed or windows may have gone away
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1460 leaving dividers lying around. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1461 if (f->faces_changed
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1462 || f->windows_structure_changed
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1463 || w->shadow_thickness_changed)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1464 need_to_clear_bottom = 1;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1465
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1466 /* The first thing we do is determine if we are going to need to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1467 clear the bottom of the window. We only need to do this if the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1468 bottom of the current display lines is below the bottom of the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1469 desired display lines. Note that the number of lines is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1470 irrelevant. Only the position matters. We also clear to the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1471 bottom of the window if the modeline has shifted position. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1472 /* #### We can't blindly not clear the bottom if f->clear is true
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1473 since there might be a window-local background. However, for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1474 those cases where there isn't, clearing the end of the window in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1475 this case sucks. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1476 if (!need_to_clear_bottom)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1477 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1478 struct display_line *cdl, *ddl;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1479
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1480 /* If the modeline has changed position or size, clear the bottom
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1481 of the window. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1482 if (!need_to_clear_bottom)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1483 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1484 cdl = ddl = 0;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1485
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1486 if (cdla_len)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1487 cdl = Dynarr_atp (cdla, 0);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1488 if (ddla_len)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1489 ddl = Dynarr_atp (ddla, 0);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1490
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1491 if (!cdl || !ddl)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1492 need_to_clear_bottom = 1;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1493 else if ((!cdl->modeline && ddl->modeline)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1494 || (cdl->modeline && !ddl->modeline))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1495 need_to_clear_bottom = 1;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1496 else if (cdl->ypos != ddl->ypos ||
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1497 cdl->ascent != ddl->ascent ||
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1498 cdl->descent != ddl->descent ||
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1499 cdl->clip != ddl->clip)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1500 need_to_clear_bottom = 1;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1501
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1502 /* #### This kludge is to make sure the modeline shadows get
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1503 redrawn if the modeline position shifts. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1504 if (need_to_clear_bottom)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1505 w->shadow_thickness_changed = 1;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1506 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1507
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1508 if (!need_to_clear_bottom)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1509 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1510 cdl = ddl = 0;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1511
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1512 if (cdla_len)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1513 cdl = Dynarr_atp (cdla, cdla_len - 1);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1514 if (ddla_len)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1515 ddl = Dynarr_atp (ddla, ddla_len - 1);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1516
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1517 if (!cdl || !ddl)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1518 need_to_clear_bottom = 1;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1519 else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1520 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1521 int cdl_bottom, ddl_bottom;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1522
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1523 cdl_bottom = cdl->ypos + cdl->descent;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1524 ddl_bottom = ddl->ypos + ddl->descent;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1525
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1526 if (cdl_bottom > ddl_bottom)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1527 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1528 need_to_clear_bottom = 1;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1529 need_to_clear_start = ddl_bottom;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1530 need_to_clear_end = cdl_bottom;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1531 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1532 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1533 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1534 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1535
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1536 /* Perform any output initialization. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1537 DEVMETH (d, output_begin, (d));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1538
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1539 /* If the window's structure has changed clear the internal border
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1540 above it if it is topmost (the function will check). */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1541 if (f->windows_structure_changed)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1542 redisplay_clear_top_of_window (w);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1543
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1544 /* Output each line. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1545 for (line = 0; line < Dynarr_length (ddla); line++)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1546 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1547 output_display_line (w, cdla, ddla, line, -1, -1);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1548 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1549
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1550 /* If the number of display lines has shrunk, adjust. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1551 if (cdla_len > ddla_len)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1552 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1553 Dynarr_length (cdla) = ddla_len;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1554 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1555
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1556 /* Output a vertical divider between windows, if necessary. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1557 if (window_needs_vertical_divider (w)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1558 && (f->windows_structure_changed || f->clear))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1559 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1560 DEVMETH (d, output_vertical_divider, (w, f->windows_structure_changed));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1561 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1562
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1563 /* Clear the rest of the window, if necessary. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1564 if (need_to_clear_bottom)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1565 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1566 redisplay_clear_bottom_of_window (w, ddla, need_to_clear_start,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1567 need_to_clear_end);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1568 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1569
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1570 w->window_end_pos[CURRENT_DISP] = w->window_end_pos[DESIRED_DISP];
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1571 Fset_marker (w->start[CURRENT_DISP],
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1572 make_int (marker_position (w->start[DESIRED_DISP])),
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1573 w->buffer);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1574 Fset_marker (w->pointm[CURRENT_DISP],
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1575 make_int (marker_position (w->pointm[DESIRED_DISP])),
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1576 w->buffer);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1577 w->last_modified[CURRENT_DISP] = w->last_modified[DESIRED_DISP];
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1578 w->last_facechange[CURRENT_DISP] = w->last_facechange[DESIRED_DISP];
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1579 Fset_marker (w->last_start[CURRENT_DISP],
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1580 Fmarker_position (w->last_start[DESIRED_DISP]), w->buffer);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1581 Fset_marker (w->last_point[CURRENT_DISP],
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1582 Fmarker_position (w->last_point[DESIRED_DISP]), w->buffer);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1583 w->last_point_x[CURRENT_DISP] = w->last_point_x[DESIRED_DISP];
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1584 w->last_point_y[CURRENT_DISP] = w->last_point_y[DESIRED_DISP];
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1585 w->shadow_thickness_changed = 0;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1586
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1587 set_window_display_buffer (w, XBUFFER (w->buffer));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1588 find_window_mirror (w)->truncate_win = window_truncation_on (w);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1589
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1590 /* Overkill on invalidating the cache. It is very bad for it to not
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1591 get invalidated when it should be. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1592 INVALIDATE_DEVICE_PIXEL_TO_GLYPH_CACHE (d);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1593
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1594 /* We don't call output_end for tty frames. Redisplay will do this
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1595 after all tty windows have been updated. This cuts down on
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1596 cursor flicker. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1597 if (FRAME_TTY_P (f))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1598 redisplay_redraw_cursor (f, 0);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1599 else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1600 DEVMETH (d, output_end, (d));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1601
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1602 #ifdef HAVE_SCROLLBARS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1603 update_window_scrollbars (w, NULL, !MINI_WINDOW_P (w), 0);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1604 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1605 }