annotate src/redisplay-msw.c @ 412:697ef44129c6 r21-2-14

Import from CVS: tag r21-2-14
author cvs
date Mon, 13 Aug 2007 11:20:41 +0200
parents de805c49cfc1
children e804706bfb8c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1 /* mswindows output and frame manipulation routines.
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
2 Copyright (C) 1994, 1995 Board of Trustees, University of Illinois.
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
3 Copyright (C) 1994 Lucid, Inc.
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
4 Copyright (C) 1995 Sun Microsystems, Inc.
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
5
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
6 This file is part of XEmacs.
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
7
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
8 XEmacs is free software; you can redistribute it and/or modify it
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
9 under the terms of the GNU General Public License as published by the
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
10 Free Software Foundation; either version 2, or (at your option) any
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
11 later version.
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
12
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
13 XEmacs is distributed in the hope that it will be useful, but WITHOUT
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
16 for more details.
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
17
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
18 You should have received a copy of the GNU General Public License
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
19 along with XEmacs; see the file COPYING. If not, write to
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
20 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
21 Boston, MA 02111-1307, USA. */
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
22
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
23 /* Synched up with: Not in FSF. */
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
24
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
25 /* Authorship:
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
26
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
27 Chuck Thompson
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
28 Lots of work done by Ben Wing for Mule
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
29 Partially rewritten for mswindows by Jonathan Harris, November 1997 for 21.0.
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
30 */
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
31
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
32 #include <config.h>
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
33 #include "lisp.h"
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
34
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
35 #include "console-msw.h"
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
36 #include "objects-msw.h"
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
37
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
38 #include "buffer.h"
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
39 #include "debug.h"
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
40 #include "events.h"
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
41 #include "faces.h"
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
42 #include "frame.h"
267
966663fcf606 Import from CVS: tag r20-5b32
cvs
parents: 265
diff changeset
43 #include "glyphs-msw.h"
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
44 #include "redisplay.h"
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
45 #include "sysdep.h"
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
46 #include "window.h"
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
47
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
48 #include "windows.h"
251
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 249
diff changeset
49 #ifdef MULE
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 249
diff changeset
50 #include "mule-ccl.h"
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 249
diff changeset
51 #include "mule-charset.h"
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 249
diff changeset
52 #endif
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
53
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
54 #define MSWINDOWS_EOL_CURSOR_WIDTH 5
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
55
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
56 /*
380
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 294
diff changeset
57 * Random forward declarations
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
58 */
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
59 static void mswindows_update_dc (HDC hdc, Lisp_Object font, Lisp_Object fg,
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
60 Lisp_Object bg, Lisp_Object bg_pmap);
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
61 static void mswindows_output_vertical_divider (struct window *w, int clear);
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
62 static void mswindows_redraw_exposed_windows (Lisp_Object window, int x,
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
63 int y, int width, int height);
284
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
64 static void mswindows_output_dibitmap (struct frame *f,
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
65 struct Lisp_Image_Instance *p,
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
66 int x, int y,
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
67 int clip_x, int clip_y,
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
68 int clip_width, int clip_height,
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
69 int width, int height,
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
70 int pixmap_offset,
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
71 int offset_bitmap);
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
72 static void mswindows_output_pixmap (struct window *w, struct display_line *dl,
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
73 Lisp_Object image_instance, int xpos,
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
74 int xoffset, int start_pixpos, int width,
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
75 face_index findex, int cursor_start,
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
76 int cursor_width, int cursor_height,
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
77 int offset_bitmap);
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
78
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
79 typedef struct textual_run
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
80 {
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
81 Lisp_Object charset;
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
82 unsigned char *ptr;
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
83 int len;
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
84 int dimension;
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
85 } textual_run;
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
86
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
87 /* Separate out the text in DYN into a series of textual runs of a
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
88 particular charset. Also convert the characters as necessary into
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
89 the format needed by XDrawImageString(), XDrawImageString16(), et
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
90 al. (This means converting to one or two byte format, possibly
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
91 tweaking the high bits, and possibly running a CCL program.) You
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
92 must pre-allocate the space used and pass it in. (This is done so
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
93 you can alloca() the space.) You need to allocate (2 * len) bytes
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
94 of TEXT_STORAGE and (len * sizeof (textual_run)) bytes of
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
95 RUN_STORAGE, where LEN is the length of the dynarr.
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
96
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
97 Returns the number of runs actually used. */
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
98
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
99 static int
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
100 separate_textual_runs (unsigned char *text_storage,
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
101 textual_run *run_storage,
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
102 CONST Emchar *str, Charcount len)
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
103 {
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
104 Lisp_Object prev_charset = Qunbound; /* not Qnil because that is a
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
105 possible valid charset when
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
106 MULE is not defined */
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
107 int runs_so_far = 0;
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
108 int i;
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
109 #ifdef MULE
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
110 struct ccl_program char_converter;
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
111 int need_ccl_conversion = 0;
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
112 #endif
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
113
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
114 for (i = 0; i < len; i++)
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
115 {
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
116 Emchar ch = str[i];
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
117 Lisp_Object charset;
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
118 int byte1, byte2;
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
119 int dimension;
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
120 int graphic;
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
121
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
122 BREAKUP_CHAR (ch, charset, byte1, byte2);
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
123 dimension = XCHARSET_DIMENSION (charset);
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
124 graphic = XCHARSET_GRAPHIC (charset);
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
125
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
126 if (!EQ (charset, prev_charset))
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
127 {
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
128 run_storage[runs_so_far].ptr = text_storage;
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
129 run_storage[runs_so_far].charset = charset;
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
130 run_storage[runs_so_far].dimension = dimension;
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
131
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
132 if (runs_so_far)
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
133 {
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
134 run_storage[runs_so_far - 1].len =
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
135 text_storage - run_storage[runs_so_far - 1].ptr;
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
136 if (run_storage[runs_so_far - 1].dimension == 2)
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
137 run_storage[runs_so_far - 1].len >>= 1;
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
138 }
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
139 runs_so_far++;
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
140 prev_charset = charset;
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
141 #ifdef MULE
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
142 {
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
143 Lisp_Object ccl_prog = XCHARSET_CCL_PROGRAM (charset);
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
144 need_ccl_conversion = !NILP (ccl_prog);
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
145 if (need_ccl_conversion)
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
146 setup_ccl_program (&char_converter, ccl_prog);
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
147 }
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
148 #endif
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
149 }
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
150
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
151 if (graphic == 0)
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
152 {
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
153 byte1 &= 0x7F;
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
154 byte2 &= 0x7F;
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
155 }
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
156 else if (graphic == 1)
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
157 {
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
158 byte1 |= 0x80;
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
159 byte2 |= 0x80;
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
160 }
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
161 #ifdef MULE
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
162 if (need_ccl_conversion)
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
163 {
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
164 char_converter.reg[0] = XCHARSET_ID (charset);
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
165 char_converter.reg[1] = byte1;
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
166 char_converter.reg[2] = byte2;
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
167 char_converter.ic = 0; /* start at beginning each time */
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
168 ccl_driver (&char_converter, 0, 0, 0, 0);
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
169 byte1 = char_converter.reg[1];
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
170 byte2 = char_converter.reg[2];
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
171 }
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
172 #endif
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
173 *text_storage++ = (unsigned char) byte1;
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
174 if (dimension == 2)
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
175 *text_storage++ = (unsigned char) byte2;
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
176 }
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
177
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
178 if (runs_so_far)
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
179 {
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
180 run_storage[runs_so_far - 1].len =
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
181 text_storage - run_storage[runs_so_far - 1].ptr;
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
182 if (run_storage[runs_so_far - 1].dimension == 2)
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
183 run_storage[runs_so_far - 1].len >>= 1;
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
184 }
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
185
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
186 return runs_so_far;
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
187 }
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
188
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
189
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
190 static int
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
191 mswindows_text_width_single_run (HDC hdc, struct face_cachel *cachel,
251
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 249
diff changeset
192 textual_run *run)
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
193 {
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
194 Lisp_Object font_inst = FACE_CACHEL_FONT (cachel, run->charset);
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
195 struct Lisp_Font_Instance *fi = XFONT_INSTANCE (font_inst);
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
196 SIZE size;
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
197
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
198 if (!fi->proportional_p || !hdc)
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
199 return (fi->width * run->len);
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
200 else
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
201 {
251
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 249
diff changeset
202 assert(run->dimension == 1); /* #### FIXME! */
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
203 mswindows_update_dc (hdc, font_inst, Qnil, Qnil, Qnil);
251
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 249
diff changeset
204 GetTextExtentPoint32 (hdc, run->ptr, run->len, &size);
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
205 return(size.cx);
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
206 }
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
207 }
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
208
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
209
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
210 /*****************************************************************************
251
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 249
diff changeset
211 mswindows_update_dc
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
212
251
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 249
diff changeset
213 Given a number of parameters munge the DC so it has those properties.
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
214 ****************************************************************************/
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
215 static void
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
216 mswindows_update_dc (HDC hdc, Lisp_Object font, Lisp_Object fg,
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
217 Lisp_Object bg, Lisp_Object bg_pmap)
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
218 {
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
219 if (!NILP (font))
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
220 SelectObject(hdc, FONT_INSTANCE_MSWINDOWS_HFONT (XFONT_INSTANCE (font)));
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
221
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
222
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
223 if (!NILP (fg))
284
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
224 {
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
225 SetTextColor (hdc, COLOR_INSTANCE_MSWINDOWS_COLOR
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
226 (XCOLOR_INSTANCE (fg)));
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
227 }
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
228 if (!NILP (bg))
284
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
229 {
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
230 SetBkMode (hdc, OPAQUE);
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
231 SetBkColor (hdc, COLOR_INSTANCE_MSWINDOWS_COLOR (XCOLOR_INSTANCE (bg)));
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
232 }
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
233 else
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
234 {
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
235 SetBkMode (hdc, TRANSPARENT);
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
236 }
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
237 }
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
238
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
239
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
240 /*****************************************************************************
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
241 mswindows_apply_face_effects
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
242
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
243 Draw underline and strikeout as if this was X.
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
244 #### On mswindows this really should be done as part of drawing the font.
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
245 The line width used is chosen arbitrarily from the font height.
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
246 ****************************************************************************/
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
247 static void
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
248 mswindows_apply_face_effects (HDC hdc, struct display_line *dl, int xpos,
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
249 int width, struct Lisp_Font_Instance *fi,
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
250 struct face_cachel *cachel,
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
251 struct face_cachel *color_cachel)
294
4b85ae5eabfb Import from CVS: tag r21-0b45
cvs
parents: 288
diff changeset
252 {
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
253 int yclip;
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
254 HBRUSH brush, oldbrush;
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
255 RECT rect;
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
256
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
257 brush = CreateSolidBrush (COLOR_INSTANCE_MSWINDOWS_COLOR (
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
258 XCOLOR_INSTANCE (color_cachel->foreground)));
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
259 if (brush)
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
260 {
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
261 yclip = dl->ypos + dl->descent - dl->clip;
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
262 rect.left = xpos;
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
263 rect.right = xpos + width;
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
264 oldbrush = SelectObject (hdc, brush);
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
265
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
266 if (cachel->underline)
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
267 {
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
268 rect.top = dl->ypos + dl->descent/2;
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
269 rect.bottom = rect.top + (fi->height >= 0x20 ? 2 : 1);
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
270 if (rect.bottom <= yclip)
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
271 FillRect (hdc, &rect, brush);
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
272 }
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
273 if (cachel->strikethru)
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
274 {
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
275 rect.top = dl->ypos + dl->descent - (dl->ascent + dl->descent)/2;
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
276 rect.bottom = rect.top + (fi->height >= 0x20 ? 2 : 1);
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
277 if (rect.bottom <= yclip)
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
278 FillRect (hdc, &rect, brush);
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
279 }
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
280
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
281 SelectObject (hdc, oldbrush);
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
282 DeleteObject (brush);
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
283 }
294
4b85ae5eabfb Import from CVS: tag r21-0b45
cvs
parents: 288
diff changeset
284 }
4b85ae5eabfb Import from CVS: tag r21-0b45
cvs
parents: 288
diff changeset
285
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
286
294
4b85ae5eabfb Import from CVS: tag r21-0b45
cvs
parents: 288
diff changeset
287 /*****************************************************************************
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
288 mswindows_output_hline
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
289
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
290 Output a horizontal line in the foreground of its face.
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
291 ****************************************************************************/
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
292 static void
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
293 mswindows_output_hline (struct window *w, struct display_line *dl, struct rune *rb)
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
294 { /* XXX Implement me */
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
295 }
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
296
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
297
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
298 /*****************************************************************************
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
299 mswindows_output_blank
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
300
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
301 Output a blank by clearing the area it covers in the background color
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
302 of its face.
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
303 ****************************************************************************/
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
304 static void
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
305 mswindows_output_blank (struct window *w, struct display_line *dl, struct rune *rb, int start_pixpos)
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
306 {
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
307 struct frame *f = XFRAME (w->frame);
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
308 RECT rect = { rb->xpos, dl->ypos-dl->ascent,
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
309 rb->xpos+rb->width, dl->ypos+dl->descent-dl->clip };
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
310 struct face_cachel *cachel = WINDOW_FACE_CACHEL (w, rb->findex);
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
311
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
312 Lisp_Object bg_pmap = WINDOW_FACE_CACHEL_BACKGROUND_PIXMAP (w, rb->findex);
388
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
313
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
314 if (!IMAGE_INSTANCEP (bg_pmap)
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
315 || !IMAGE_INSTANCE_PIXMAP_TYPE_P (XIMAGE_INSTANCE (bg_pmap)))
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
316 bg_pmap = Qnil;
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
317
280
7df0dd720c89 Import from CVS: tag r21-0b38
cvs
parents: 278
diff changeset
318 if (!NILP(bg_pmap))
7df0dd720c89 Import from CVS: tag r21-0b38
cvs
parents: 278
diff changeset
319 {
284
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
320 /* blank the background in the appropriate color */
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
321 mswindows_update_dc (FRAME_MSWINDOWS_DC (f), Qnil, cachel->foreground,
284
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
322 cachel->background, Qnil);
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
323
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
324 mswindows_output_pixmap (w, dl, bg_pmap,
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
325 rb->xpos, 0 /*rb->object.dglyph.xoffset*/,
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
326 start_pixpos, rb->width, rb->findex,
284
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
327 0, 0, 0, TRUE);
280
7df0dd720c89 Import from CVS: tag r21-0b38
cvs
parents: 278
diff changeset
328 }
7df0dd720c89 Import from CVS: tag r21-0b38
cvs
parents: 278
diff changeset
329 else
7df0dd720c89 Import from CVS: tag r21-0b38
cvs
parents: 278
diff changeset
330 {
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
331 mswindows_update_dc (FRAME_MSWINDOWS_DC (f), Qnil, Qnil,
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
332 cachel->background, Qnil);
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
333
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
334 ExtTextOut (FRAME_MSWINDOWS_DC (f), 0, 0, ETO_OPAQUE,
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
335 &rect, NULL, 0, NULL);
280
7df0dd720c89 Import from CVS: tag r21-0b38
cvs
parents: 278
diff changeset
336 }
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
337 }
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
338
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
339
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
340 /*****************************************************************************
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
341 mswindows_output_cursor
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
342
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
343 Draw a normal or end-of-line cursor. The end-of-line cursor is
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
344 narrower than the normal cursor.
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
345 ****************************************************************************/
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
346 static void
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
347 mswindows_output_cursor (struct window *w, struct display_line *dl, int xpos,
269
b2472a1930f2 Import from CVS: tag r20-5b33
cvs
parents: 267
diff changeset
348 int width, face_index findex, Emchar ch, int image_p)
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
349 {
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
350 struct frame *f = XFRAME (w->frame);
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
351 struct device *d = XDEVICE (f->device);
384
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
352 struct face_cachel *cachel=0;
227
0e522484dd2a Import from CVS: tag r20-5b12
cvs
parents: 223
diff changeset
353 Lisp_Object font = Qnil;
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
354 int focus = EQ (w->frame, DEVICE_FRAME_WITH_FOCUS_REAL (d));
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
355 HDC hdc = FRAME_MSWINDOWS_DC (f);
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
356 unsigned int face_index=0;
227
0e522484dd2a Import from CVS: tag r20-5b12
cvs
parents: 223
diff changeset
357 char *p_char = NULL;
0e522484dd2a Import from CVS: tag r20-5b12
cvs
parents: 223
diff changeset
358 int n_char = 0;
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
359 RECT rect = { xpos,
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
360 dl->ypos - dl->ascent,
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
361 xpos + width,
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
362 dl->ypos + dl->descent - dl->clip};
239
41f2f0e326e9 Import from CVS: tag r20-5b18
cvs
parents: 227
diff changeset
363 Lisp_Object bar = symbol_value_in_buffer (Qbar_cursor,
41f2f0e326e9 Import from CVS: tag r20-5b18
cvs
parents: 227
diff changeset
364 WINDOW_BUFFER (w));
269
b2472a1930f2 Import from CVS: tag r20-5b33
cvs
parents: 267
diff changeset
365 int bar_p = image_p || !NILP (bar);
b2472a1930f2 Import from CVS: tag r20-5b33
cvs
parents: 267
diff changeset
366 int cursor_p = !NILP (w->text_cursor_visible_p);
b2472a1930f2 Import from CVS: tag r20-5b33
cvs
parents: 267
diff changeset
367 int real_char_p = ch != 0;
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
368
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
369 if (real_char_p)
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
370 {
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
371 /* Use the font from the underlying character */
269
b2472a1930f2 Import from CVS: tag r20-5b33
cvs
parents: 267
diff changeset
372 cachel = WINDOW_FACE_CACHEL (w, findex);
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
373
294
4b85ae5eabfb Import from CVS: tag r21-0b45
cvs
parents: 288
diff changeset
374 /* #### MULE: Need to know the charset! */
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
375 font = FACE_CACHEL_FONT (cachel, Vcharset_ascii);
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
376 }
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
377
239
41f2f0e326e9 Import from CVS: tag r20-5b18
cvs
parents: 227
diff changeset
378 if ((focus || bar_p) && real_char_p)
227
0e522484dd2a Import from CVS: tag r20-5b12
cvs
parents: 223
diff changeset
379 {
269
b2472a1930f2 Import from CVS: tag r20-5b33
cvs
parents: 267
diff changeset
380 p_char = (char*) &ch;
227
0e522484dd2a Import from CVS: tag r20-5b12
cvs
parents: 223
diff changeset
381 n_char = 1;
0e522484dd2a Import from CVS: tag r20-5b12
cvs
parents: 223
diff changeset
382 }
0e522484dd2a Import from CVS: tag r20-5b12
cvs
parents: 223
diff changeset
383
269
b2472a1930f2 Import from CVS: tag r20-5b33
cvs
parents: 267
diff changeset
384 if (!image_p)
b2472a1930f2 Import from CVS: tag r20-5b33
cvs
parents: 267
diff changeset
385 {
294
4b85ae5eabfb Import from CVS: tag r21-0b45
cvs
parents: 288
diff changeset
386 struct face_cachel *color_cachel;
4b85ae5eabfb Import from CVS: tag r21-0b45
cvs
parents: 288
diff changeset
387
269
b2472a1930f2 Import from CVS: tag r20-5b33
cvs
parents: 267
diff changeset
388 /* Use cursor fg/bg for block cursor, or character fg/bg for the bar
b2472a1930f2 Import from CVS: tag r20-5b33
cvs
parents: 267
diff changeset
389 or when we need to erase the cursor. Output nothing at eol if bar
b2472a1930f2 Import from CVS: tag r20-5b33
cvs
parents: 267
diff changeset
390 cursor */
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
391 face_index = get_builtin_face_cache_index (w, Vtext_cursor_face);
294
4b85ae5eabfb Import from CVS: tag r21-0b45
cvs
parents: 288
diff changeset
392 color_cachel = WINDOW_FACE_CACHEL (w, ((!cursor_p || bar_p) ?
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
393 findex : face_index));
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
394 mswindows_update_dc (hdc, font, color_cachel->foreground,
294
4b85ae5eabfb Import from CVS: tag r21-0b45
cvs
parents: 288
diff changeset
395 color_cachel->background, Qnil);
269
b2472a1930f2 Import from CVS: tag r20-5b33
cvs
parents: 267
diff changeset
396 ExtTextOut (hdc, xpos, dl->ypos, ETO_OPAQUE|ETO_CLIPPED, &rect, p_char, n_char, NULL);
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
397 if (real_char_p && (cachel->underline || cachel->strikethru))
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
398 mswindows_apply_face_effects (hdc, dl, xpos, width,
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
399 XFONT_INSTANCE (font),
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
400 cachel, color_cachel);
269
b2472a1930f2 Import from CVS: tag r20-5b33
cvs
parents: 267
diff changeset
401 }
b2472a1930f2 Import from CVS: tag r20-5b33
cvs
parents: 267
diff changeset
402
b2472a1930f2 Import from CVS: tag r20-5b33
cvs
parents: 267
diff changeset
403 if (!cursor_p)
b2472a1930f2 Import from CVS: tag r20-5b33
cvs
parents: 267
diff changeset
404 return;
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
405
239
41f2f0e326e9 Import from CVS: tag r20-5b18
cvs
parents: 227
diff changeset
406 if (focus && bar_p)
41f2f0e326e9 Import from CVS: tag r20-5b18
cvs
parents: 227
diff changeset
407 {
269
b2472a1930f2 Import from CVS: tag r20-5b33
cvs
parents: 267
diff changeset
408 rect.right = rect.left + (EQ (bar, Qt) ? 1 : min (2, width));
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
409 face_index = get_builtin_face_cache_index (w, Vtext_cursor_face);
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
410 cachel = WINDOW_FACE_CACHEL (w, face_index);
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
411 mswindows_update_dc (hdc, Qnil, Qnil, cachel->background, Qnil);
251
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 249
diff changeset
412 ExtTextOut (hdc, xpos, dl->ypos, ETO_OPAQUE, &rect, NULL, 0, NULL);
239
41f2f0e326e9 Import from CVS: tag r20-5b18
cvs
parents: 227
diff changeset
413 }
41f2f0e326e9 Import from CVS: tag r20-5b18
cvs
parents: 227
diff changeset
414 else if (!focus)
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
415 {
294
4b85ae5eabfb Import from CVS: tag r21-0b45
cvs
parents: 288
diff changeset
416 /* Now have real character drawn in its own color. We deflate
239
41f2f0e326e9 Import from CVS: tag r20-5b18
cvs
parents: 227
diff changeset
417 the rectangle so character cell will be bounded by the
41f2f0e326e9 Import from CVS: tag r20-5b18
cvs
parents: 227
diff changeset
418 previously drawn cursor shape */
41f2f0e326e9 Import from CVS: tag r20-5b18
cvs
parents: 227
diff changeset
419 InflateRect (&rect, -1, -1);
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
420
239
41f2f0e326e9 Import from CVS: tag r20-5b18
cvs
parents: 227
diff changeset
421 if (real_char_p)
41f2f0e326e9 Import from CVS: tag r20-5b18
cvs
parents: 227
diff changeset
422 {
269
b2472a1930f2 Import from CVS: tag r20-5b33
cvs
parents: 267
diff changeset
423 p_char = (char*) &ch;
239
41f2f0e326e9 Import from CVS: tag r20-5b18
cvs
parents: 227
diff changeset
424 n_char = 1;
41f2f0e326e9 Import from CVS: tag r20-5b18
cvs
parents: 227
diff changeset
425 }
41f2f0e326e9 Import from CVS: tag r20-5b18
cvs
parents: 227
diff changeset
426
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
427 face_index = get_builtin_face_cache_index (w, Vdefault_face);
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
428 cachel = WINDOW_FACE_CACHEL (w, (real_char_p ? findex : face_index));
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
429 mswindows_update_dc (hdc, Qnil, cachel->foreground,
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
430 cachel->background, Qnil);
251
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 249
diff changeset
431 ExtTextOut (hdc, xpos, dl->ypos, ETO_OPAQUE | ETO_CLIPPED,
239
41f2f0e326e9 Import from CVS: tag r20-5b18
cvs
parents: 227
diff changeset
432 &rect, p_char, n_char, NULL);
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
433 if (cachel->underline || cachel->strikethru)
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
434 mswindows_apply_face_effects (hdc, dl, xpos+1, width-2,
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
435 XFONT_INSTANCE (font),
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
436 cachel, cachel);
239
41f2f0e326e9 Import from CVS: tag r20-5b18
cvs
parents: 227
diff changeset
437 }
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
438 }
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
439
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
440
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
441 /*****************************************************************************
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
442 mswindows_output_string
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
443
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
444 Given a string and a starting position, output that string in the
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
445 given face.
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
446 Correctly handles multiple charsets in the string.
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
447
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
448 The meaning of the parameters is something like this:
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
449
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
450 W Window that the text is to be displayed in.
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
451 DL Display line that this text is on. The values in the
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
452 structure are used to determine the vertical position and
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
453 clipping range of the text.
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
454 BUF Dynamic array of Emchars specifying what is actually to be
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
455 drawn.
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
456 XPOS X position in pixels where the text should start being drawn.
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
457 XOFFSET Number of pixels to be chopped off the left side of the
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
458 text. The effect is as if the text were shifted to the
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
459 left this many pixels and clipped at XPOS.
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
460 CLIP_START Clip everything left of this X position.
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
461 WIDTH Clip everything right of XPOS + WIDTH.
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
462 FINDEX Index for the face cache element describing how to display
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
463 the text.
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
464 ****************************************************************************/
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
465 void
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
466 mswindows_output_string (struct window *w, struct display_line *dl,
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
467 Emchar_dynarr *buf, int xpos, int xoffset, int clip_start,
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
468 int width, face_index findex)
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
469 {
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
470 struct frame *f = XFRAME (w->frame);
245
51092a27c943 Import from CVS: tag r20-5b21
cvs
parents: 239
diff changeset
471 /* struct device *d = XDEVICE (f->device);*/
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 269
diff changeset
472 Lisp_Object window;
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
473 HDC hdc = FRAME_MSWINDOWS_DC (f);
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
474 int clip_end;
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
475 Lisp_Object bg_pmap;
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
476 int len = Dynarr_length (buf);
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
477 unsigned char *text_storage = (unsigned char *) alloca (2 * len);
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
478 textual_run *runs = alloca_array (textual_run, len);
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
479 int nruns;
284
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
480 int i, height;
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
481 RECT rect;
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
482 struct face_cachel *cachel = WINDOW_FACE_CACHEL (w, findex);
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
483
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
484 XSETWINDOW (window, w);
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
485
294
4b85ae5eabfb Import from CVS: tag r21-0b45
cvs
parents: 288
diff changeset
486 #if 0 /* #### FIXME? */
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
487 /* We can't work out the width before we've set the font in the DC */
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
488 if (width < 0)
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
489 width = mswindows_text_width (cachel, Dynarr_atp (buf, 0), Dynarr_length (buf));
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
490 #else
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
491 assert(width>=0);
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
492 #endif
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
493
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
494 /* Regularize the variables passed in. */
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
495 if (clip_start < xpos)
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
496 clip_start = xpos;
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
497 clip_end = xpos + width;
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
498 if (clip_start >= clip_end)
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
499 /* It's all clipped out. */
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
500 return;
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
501
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
502 xpos -= xoffset;
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
503
284
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
504 /* sort out the destination rectangle */
388
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
505 height = DISPLAY_LINE_HEIGHT (dl);
284
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
506 rect.left = clip_start;
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
507 rect.top = dl->ypos - dl->ascent;
284
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
508 rect.right = clip_end;
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
509 rect.bottom = height + dl->ypos - dl->ascent;
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
510
284
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
511 /* output the background pixmap if there is one */
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
512 bg_pmap = cachel->background_pixmap;
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
513 if (!IMAGE_INSTANCEP (bg_pmap)
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
514 || !IMAGE_INSTANCE_PIXMAP_TYPE_P (XIMAGE_INSTANCE (bg_pmap)))
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
515 bg_pmap = Qnil;
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
516
284
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
517 if (!NILP(bg_pmap))
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
518 {
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
519 /* blank the background in the appropriate color */
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
520 mswindows_update_dc (hdc, Qnil, cachel->foreground,
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
521 cachel->background, Qnil);
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
522
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
523 mswindows_output_pixmap (w, dl, bg_pmap,
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
524 xpos, xoffset,
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
525 clip_start, width, findex,
284
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
526 0, 0, 0, TRUE);
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
527 /* output pixmap calls this so we have to recall to get correct
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
528 references */
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
529 cachel = WINDOW_FACE_CACHEL (w, findex);
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
530 }
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
531
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
532 nruns = separate_textual_runs (text_storage, runs, Dynarr_atp (buf, 0),
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
533 Dynarr_length (buf));
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
534
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
535 for (i = 0; i < nruns; i++)
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
536 {
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
537 Lisp_Object font = FACE_CACHEL_FONT (cachel, runs[i].charset);
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
538 struct Lisp_Font_Instance *fi = XFONT_INSTANCE (font);
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
539 int this_width;
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
540
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
541 if (EQ (font, Vthe_null_font_instance))
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
542 continue;
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
543
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
544 mswindows_update_dc (hdc, font, cachel->foreground,
251
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 249
diff changeset
545 NILP(bg_pmap) ? cachel->background : Qnil, Qnil);
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
546
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
547 this_width = mswindows_text_width_single_run (hdc, cachel, runs + i);
284
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
548
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
549 /* cope with fonts taller than lines */
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
550 if ((int) fi->height < (int) (height + dl->clip))
280
7df0dd720c89 Import from CVS: tag r21-0b38
cvs
parents: 278
diff changeset
551 {
284
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
552 int clear_start = max (xpos, clip_start);
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
553 int clear_end = min (xpos + this_width, clip_end);
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
554
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
555 {
384
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
556 redisplay_clear_region (window, findex, clear_start,
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
557 dl->ypos - dl->ascent,
284
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
558 clear_end - clear_start,
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
559 height);
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
560 /* output pixmap calls this so we have to recall to get correct
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
561 references */
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
562 cachel = WINDOW_FACE_CACHEL (w, findex);
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
563 }
280
7df0dd720c89 Import from CVS: tag r21-0b38
cvs
parents: 278
diff changeset
564 }
284
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
565
294
4b85ae5eabfb Import from CVS: tag r21-0b45
cvs
parents: 288
diff changeset
566 assert (runs[i].dimension == 1); /* #### FIXME: Broken when Mule? */
227
0e522484dd2a Import from CVS: tag r20-5b12
cvs
parents: 223
diff changeset
567 ExtTextOut (hdc, xpos, dl->ypos,
0e522484dd2a Import from CVS: tag r20-5b12
cvs
parents: 223
diff changeset
568 NILP(bg_pmap) ? ETO_CLIPPED | ETO_OPAQUE : ETO_CLIPPED,
0e522484dd2a Import from CVS: tag r20-5b12
cvs
parents: 223
diff changeset
569 &rect, (char *) runs[i].ptr, runs[i].len, NULL);
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
570
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
571 /* #### X does underline/strikethrough here so we do the same.
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
572 On mswindows, underline/strikethrough really belongs to the font */
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
573 if (cachel->underline || cachel->strikethru)
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
574 mswindows_apply_face_effects (hdc, dl, xpos, this_width, fi,
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
575 cachel, cachel);
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
576 xpos += this_width;
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
577 }
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
578 }
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
579
284
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
580 static void
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
581 mswindows_output_dibitmap (struct frame *f, struct Lisp_Image_Instance *p,
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
582 int x, int y,
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
583 int clip_x, int clip_y,
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
584 int clip_width, int clip_height,
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
585 int width, int height, int pixmap_offset,
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
586 int offset_bitmap)
267
966663fcf606 Import from CVS: tag r20-5b32
cvs
parents: 265
diff changeset
587 {
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
588 HDC hdc = FRAME_MSWINDOWS_DC (f);
284
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
589 HGDIOBJ old=NULL;
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
590 COLORREF bgcolor = GetBkColor (hdc);
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
591 int need_clipping = (clip_x || clip_y);
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
592 int yoffset=0;
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
593 int xoffset=0;
267
966663fcf606 Import from CVS: tag r20-5b32
cvs
parents: 265
diff changeset
594
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
595 /* do we need to offset the pixmap vertically? this is necessary
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
596 for background pixmaps. */
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
597 if (offset_bitmap)
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
598 {
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
599 yoffset = y % IMAGE_INSTANCE_PIXMAP_HEIGHT (p);
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
600 xoffset = x % IMAGE_INSTANCE_PIXMAP_WIDTH (p);
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
601 /* the width is handled by mswindows_output_pixmap_region */
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
602 }
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
603
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
604 if (need_clipping)
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
605 {
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
606 }
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
607
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
608 /* first blt the mask */
284
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
609 if (IMAGE_INSTANCE_MSWINDOWS_MASK (p))
267
966663fcf606 Import from CVS: tag r20-5b32
cvs
parents: 265
diff changeset
610 {
284
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
611 RGBQUAD col;
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
612 col.rgbBlue = GetBValue (bgcolor);
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
613 col.rgbRed = GetRValue (bgcolor);
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
614 col.rgbGreen = GetGValue (bgcolor);
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
615 col.rgbReserved = 0;
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
616
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
617 old = SelectObject (FRAME_MSWINDOWS_CDC (f),
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
618 IMAGE_INSTANCE_MSWINDOWS_MASK (p));
284
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
619
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
620 SetDIBColorTable (FRAME_MSWINDOWS_CDC (f), 1, 1, &col);
284
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
621
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
622 BitBlt (hdc,
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
623 x,y,
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
624 width, height,
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
625 FRAME_MSWINDOWS_CDC (f),
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
626 xoffset,yoffset,
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
627 SRCCOPY);
284
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
628
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
629 SelectObject (FRAME_MSWINDOWS_CDC (f), old);
267
966663fcf606 Import from CVS: tag r20-5b32
cvs
parents: 265
diff changeset
630 }
284
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
631
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
632 /* now blt the bitmap itself. */
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
633 old = SelectObject (FRAME_MSWINDOWS_CDC (f),
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
634 IMAGE_INSTANCE_MSWINDOWS_BITMAP (p));
267
966663fcf606 Import from CVS: tag r20-5b32
cvs
parents: 265
diff changeset
635
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
636 BitBlt (hdc,
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
637 x,y,
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
638 width, height,
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
639 FRAME_MSWINDOWS_CDC (f),
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
640 xoffset, yoffset,
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
641 IMAGE_INSTANCE_MSWINDOWS_MASK (p) ? SRCINVERT : SRCCOPY);
284
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
642
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
643 SelectObject (FRAME_MSWINDOWS_CDC (f),old);
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
644
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
645 if (need_clipping)
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
646 {
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
647 }
284
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
648 }
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
649
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
650 /*
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
651 * X gc's have this nice property that setting the bg pixmap will
284
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
652 * output it offset relative to the window. Windows doesn't have this
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
653 * feature so we have to emulate this by outputting multiple pixmaps
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
654 */
284
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
655 static void
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
656 mswindows_output_dibitmap_region (struct frame *f,
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
657 struct Lisp_Image_Instance *p,
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
658 int x, int y,
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
659 int clip_x, int clip_y,
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
660 int clip_width, int clip_height,
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
661 int width, int height, int pixmap_offset,
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
662 int offset_bitmap)
284
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
663 {
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
664 int pwidth = min (width, IMAGE_INSTANCE_PIXMAP_WIDTH (p));
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
665 int pheight = min (height, IMAGE_INSTANCE_PIXMAP_HEIGHT (p));
284
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
666 int pxoffset = 0, pyoffset = 0;
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
667
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
668 /* when doing a bg pixmap do a partial pixmap first so that we
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
669 blt whole pixmaps thereafter */
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
670
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
671 if (offset_bitmap)
284
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
672 {
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
673 pheight = min (pheight, IMAGE_INSTANCE_PIXMAP_HEIGHT (p) -
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
674 y % IMAGE_INSTANCE_PIXMAP_HEIGHT (p));
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
675 }
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
676
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
677 while (pheight > 0)
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
678 {
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
679 if (offset_bitmap)
284
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
680 {
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
681 pwidth = min (min (width, IMAGE_INSTANCE_PIXMAP_WIDTH (p)),
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
682 IMAGE_INSTANCE_PIXMAP_WIDTH (p) -
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
683 x % IMAGE_INSTANCE_PIXMAP_WIDTH (p));
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
684 pxoffset = 0;
284
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
685 }
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
686 while (pwidth > 0)
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
687 {
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
688 mswindows_output_dibitmap (f, p,
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
689 x + pxoffset, y + pyoffset,
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
690 clip_x, clip_y,
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
691 clip_width, clip_height,
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
692 pwidth, pheight, pixmap_offset,
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
693 offset_bitmap);
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
694 pxoffset += pwidth;
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
695 pwidth = min ((width-pxoffset),
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
696 IMAGE_INSTANCE_PIXMAP_WIDTH (p));
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
697 }
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
698 pyoffset += pheight;
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
699 pheight = min ((height-pyoffset),
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
700 IMAGE_INSTANCE_PIXMAP_HEIGHT (p));
284
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
701 }
267
966663fcf606 Import from CVS: tag r20-5b32
cvs
parents: 265
diff changeset
702 }
966663fcf606 Import from CVS: tag r20-5b32
cvs
parents: 265
diff changeset
703
966663fcf606 Import from CVS: tag r20-5b32
cvs
parents: 265
diff changeset
704 static void
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
705 mswindows_output_pixmap (struct window *w, struct display_line *dl,
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
706 Lisp_Object image_instance, int xpos, int xoffset,
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
707 int start_pixpos, int width, face_index findex,
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
708 int cursor_start, int cursor_width, int cursor_height,
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
709 int offset_bitmap)
267
966663fcf606 Import from CVS: tag r20-5b32
cvs
parents: 265
diff changeset
710 {
966663fcf606 Import from CVS: tag r20-5b32
cvs
parents: 265
diff changeset
711 struct frame *f = XFRAME (w->frame);
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
712 HDC hdc = FRAME_MSWINDOWS_DC (f);
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
713
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
714 struct Lisp_Image_Instance *p = XIMAGE_INSTANCE (image_instance);
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
715 Lisp_Object window;
267
966663fcf606 Import from CVS: tag r20-5b32
cvs
parents: 265
diff changeset
716
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
717 int lheight = DISPLAY_LINE_HEIGHT (dl);
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
718 int pheight = ((int) IMAGE_INSTANCE_PIXMAP_HEIGHT (p) > lheight ? lheight :
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
719 IMAGE_INSTANCE_PIXMAP_HEIGHT (p));
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
720 int clip_x, clip_y, clip_width, clip_height;
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
721
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
722 /* The pixmap_offset is used to center the pixmap on lines which are
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
723 shorter than it is. This results in odd effects when scrolling
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
724 pixmaps off of the bottom. Let's try not using it. */
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
725 #if 0
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
726 int pixmap_offset = (int) (IMAGE_INSTANCE_PIXMAP_HEIGHT (p) - lheight) / 2;
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
727 #else
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
728 int pixmap_offset = 0;
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
729 #endif
267
966663fcf606 Import from CVS: tag r20-5b32
cvs
parents: 265
diff changeset
730
966663fcf606 Import from CVS: tag r20-5b32
cvs
parents: 265
diff changeset
731 XSETWINDOW (window, w);
966663fcf606 Import from CVS: tag r20-5b32
cvs
parents: 265
diff changeset
732
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
733 if ((start_pixpos >= 0 && start_pixpos > xpos) || xoffset)
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
734 {
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
735 if (start_pixpos > xpos && start_pixpos > xpos + width)
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
736 return;
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
737
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
738 clip_x = xoffset;
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
739 clip_width = width;
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
740 if (start_pixpos > xpos)
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
741 {
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
742 clip_x += (start_pixpos - xpos);
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
743 clip_width -= (start_pixpos - xpos);
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
744 }
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
745 }
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
746 else
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
747 {
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
748 clip_x = 0;
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
749 clip_width = 0;
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
750 }
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
751
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
752 /* Place markers for possible future functionality (clipping the top
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
753 half instead of the bottom half; think pixel scrolling). */
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
754 clip_y = 0;
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
755 clip_height = pheight;
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
756
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
757 /* Clear the area the pixmap is going into. The pixmap itself will
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
758 always take care of the full width. We don't want to clear where
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
759 it is going to go in order to avoid flicker. So, all we have to
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
760 take care of is any area above or below the pixmap. */
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
761 /* #### We take a shortcut for now. We know that since we have
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
762 pixmap_offset hardwired to 0 that the pixmap is against the top
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
763 edge so all we have to worry about is below it. */
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
764 /* #### Unless the pixmap has a mask in which case we have to clear
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
765 the whole damn thing since we can't yet clear just the area not
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
766 included in the mask. */
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
767 if (((int) (dl->ypos - dl->ascent + pheight) <
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
768 (int) (dl->ypos + dl->descent - dl->clip))
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
769 || IMAGE_INSTANCE_MSWINDOWS_MASK (p))
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
770 {
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
771 int clear_x, clear_y, clear_width, clear_height;
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
772
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
773 if (IMAGE_INSTANCE_MSWINDOWS_MASK (p))
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
774 {
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
775 clear_y = dl->ypos - dl->ascent;
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
776 clear_height = lheight;
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
777 }
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
778 else
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
779 {
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
780 clear_y = dl->ypos - dl->ascent + pheight;
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
781 clear_height = lheight - pheight;
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
782 }
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
783
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
784 if (start_pixpos >= 0 && start_pixpos > xpos)
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
785 {
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
786 clear_x = start_pixpos;
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
787 clear_width = xpos + width - start_pixpos;
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
788 }
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
789 else
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
790 {
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
791 clear_x = xpos;
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
792 clear_width = width;
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
793 }
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
794
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
795 if (!offset_bitmap) /* i.e. not a bg pixmap */
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
796 redisplay_clear_region (window, findex, clear_x, clear_y,
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
797 clear_width, clear_height);
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
798 }
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
799
284
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
800 /* Output the pixmap. Have to do this as many times as is required
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
801 to fill the given area */
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
802 mswindows_update_dc (hdc, Qnil,
284
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
803 WINDOW_FACE_CACHEL_FOREGROUND (w, findex),
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
804 WINDOW_FACE_CACHEL_BACKGROUND (w, findex), Qnil);
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
805
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
806 mswindows_output_dibitmap_region (f, p, xpos - xoffset,
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
807 dl->ypos - dl->ascent,
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
808 clip_x, clip_y, clip_width, clip_height,
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
809 width + xoffset, pheight, pixmap_offset,
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
810 offset_bitmap);
267
966663fcf606 Import from CVS: tag r20-5b32
cvs
parents: 265
diff changeset
811 }
227
0e522484dd2a Import from CVS: tag r20-5b12
cvs
parents: 223
diff changeset
812
0e522484dd2a Import from CVS: tag r20-5b12
cvs
parents: 223
diff changeset
813 #ifdef HAVE_SCROLLBARS
0e522484dd2a Import from CVS: tag r20-5b12
cvs
parents: 223
diff changeset
814 /*
0e522484dd2a Import from CVS: tag r20-5b12
cvs
parents: 223
diff changeset
815 * This function paints window's deadbox, a rectangle between window
0e522484dd2a Import from CVS: tag r20-5b12
cvs
parents: 223
diff changeset
816 * borders and two short edges of both scrollbars.
0e522484dd2a Import from CVS: tag r20-5b12
cvs
parents: 223
diff changeset
817 *
0e522484dd2a Import from CVS: tag r20-5b12
cvs
parents: 223
diff changeset
818 * Function checks whether deadbox intersects with the rectangle pointed
0e522484dd2a Import from CVS: tag r20-5b12
cvs
parents: 223
diff changeset
819 * to by PRC, and paints only the intersection
0e522484dd2a Import from CVS: tag r20-5b12
cvs
parents: 223
diff changeset
820 */
0e522484dd2a Import from CVS: tag r20-5b12
cvs
parents: 223
diff changeset
821 static void
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
822 mswindows_redisplay_deadbox_maybe (struct window *w, CONST RECT* prc)
227
0e522484dd2a Import from CVS: tag r20-5b12
cvs
parents: 223
diff changeset
823 {
0e522484dd2a Import from CVS: tag r20-5b12
cvs
parents: 223
diff changeset
824 int sbh = window_scrollbar_height (w);
0e522484dd2a Import from CVS: tag r20-5b12
cvs
parents: 223
diff changeset
825 int sbw = window_scrollbar_width (w);
0e522484dd2a Import from CVS: tag r20-5b12
cvs
parents: 223
diff changeset
826 RECT rect_dead, rect_paint;
0e522484dd2a Import from CVS: tag r20-5b12
cvs
parents: 223
diff changeset
827 if (sbh == 0 || sbw == 0)
0e522484dd2a Import from CVS: tag r20-5b12
cvs
parents: 223
diff changeset
828 return;
0e522484dd2a Import from CVS: tag r20-5b12
cvs
parents: 223
diff changeset
829
282
c42ec1d1cded Import from CVS: tag r21-0b39
cvs
parents: 280
diff changeset
830 if (!NILP (w->scrollbar_on_left_p))
284
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
831 rect_dead.left = WINDOW_LEFT (w);
227
0e522484dd2a Import from CVS: tag r20-5b12
cvs
parents: 223
diff changeset
832 else
284
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
833 rect_dead.left = WINDOW_TEXT_RIGHT (w);
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
834 rect_dead.right = rect_dead.left + sbw;
227
0e522484dd2a Import from CVS: tag r20-5b12
cvs
parents: 223
diff changeset
835
282
c42ec1d1cded Import from CVS: tag r21-0b39
cvs
parents: 280
diff changeset
836 if (!NILP (w->scrollbar_on_top_p))
284
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
837 rect_dead.top = WINDOW_TOP (w);
227
0e522484dd2a Import from CVS: tag r20-5b12
cvs
parents: 223
diff changeset
838 else
284
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
839 rect_dead.top = WINDOW_TEXT_BOTTOM (w);
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
840 rect_dead.bottom = rect_dead.top + sbh;
227
0e522484dd2a Import from CVS: tag r20-5b12
cvs
parents: 223
diff changeset
841
0e522484dd2a Import from CVS: tag r20-5b12
cvs
parents: 223
diff changeset
842 if (IntersectRect (&rect_paint, &rect_dead, prc))
282
c42ec1d1cded Import from CVS: tag r21-0b39
cvs
parents: 280
diff changeset
843 {
c42ec1d1cded Import from CVS: tag r21-0b39
cvs
parents: 280
diff changeset
844 struct frame *f = XFRAME (WINDOW_FRAME (w));
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
845 FillRect (FRAME_MSWINDOWS_DC (f), &rect_paint,
282
c42ec1d1cded Import from CVS: tag r21-0b39
cvs
parents: 280
diff changeset
846 (HBRUSH) (COLOR_BTNFACE+1));
c42ec1d1cded Import from CVS: tag r21-0b39
cvs
parents: 280
diff changeset
847 }
227
0e522484dd2a Import from CVS: tag r20-5b12
cvs
parents: 223
diff changeset
848 }
0e522484dd2a Import from CVS: tag r20-5b12
cvs
parents: 223
diff changeset
849
0e522484dd2a Import from CVS: tag r20-5b12
cvs
parents: 223
diff changeset
850 #endif /* HAVE_SCROLLBARS */
0e522484dd2a Import from CVS: tag r20-5b12
cvs
parents: 223
diff changeset
851
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
852 /*****************************************************************************
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
853 mswindows_redraw_exposed_window
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
854
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
855 Given a bounding box for an area that needs to be redrawn, determine
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
856 what parts of what lines are contained within and re-output their
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
857 contents.
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
858 Copied from redisplay-x.c
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
859 ****************************************************************************/
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
860 static void
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
861 mswindows_redraw_exposed_window (struct window *w, int x, int y, int width,
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
862 int height)
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
863 {
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
864 struct frame *f = XFRAME (w->frame);
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
865 int line;
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
866 int orig_windows_structure_changed;
227
0e522484dd2a Import from CVS: tag r20-5b12
cvs
parents: 223
diff changeset
867 RECT rect_window = { WINDOW_LEFT (w), WINDOW_TOP (w),
0e522484dd2a Import from CVS: tag r20-5b12
cvs
parents: 223
diff changeset
868 WINDOW_RIGHT (w), WINDOW_BOTTOM (w) };
0e522484dd2a Import from CVS: tag r20-5b12
cvs
parents: 223
diff changeset
869 RECT rect_expose = { x, y, x + width, y + height };
0e522484dd2a Import from CVS: tag r20-5b12
cvs
parents: 223
diff changeset
870 RECT rect_draw;
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
871
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
872 display_line_dynarr *cdla = window_display_lines (w, CURRENT_DISP);
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
873
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
874 if (!NILP (w->vchild))
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
875 {
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
876 mswindows_redraw_exposed_windows (w->vchild, x, y, width, height);
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
877 return;
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
878 }
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
879 else if (!NILP (w->hchild))
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
880 {
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
881 mswindows_redraw_exposed_windows (w->hchild, x, y, width, height);
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
882 return;
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
883 }
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
884
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
885 /* If the window doesn't intersect the exposed region, we're done here. */
227
0e522484dd2a Import from CVS: tag r20-5b12
cvs
parents: 223
diff changeset
886 if (!IntersectRect (&rect_draw, &rect_window, &rect_expose))
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
887 return;
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
888
227
0e522484dd2a Import from CVS: tag r20-5b12
cvs
parents: 223
diff changeset
889 /* We do this to make sure that the 3D modelines get redrawn if
0e522484dd2a Import from CVS: tag r20-5b12
cvs
parents: 223
diff changeset
890 they are in the exposed region. */
0e522484dd2a Import from CVS: tag r20-5b12
cvs
parents: 223
diff changeset
891 orig_windows_structure_changed = f->windows_structure_changed;
0e522484dd2a Import from CVS: tag r20-5b12
cvs
parents: 223
diff changeset
892 f->windows_structure_changed = 1;
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
893
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
894 if (window_needs_vertical_divider (w))
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
895 {
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
896 mswindows_output_vertical_divider (w, 0);
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
897 }
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
898
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
899 for (line = 0; line < Dynarr_length (cdla); line++)
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
900 {
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
901 struct display_line *cdl = Dynarr_atp (cdla, line);
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
902 int top_y = cdl->ypos - cdl->ascent;
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
903 int bottom_y = cdl->ypos + cdl->descent;
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
904
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
905 if (bottom_y >= rect_draw.top)
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
906 {
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
907 if (top_y > rect_draw.bottom)
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
908 {
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
909 if (line == 0)
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
910 continue;
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
911 else
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
912 break;
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
913 }
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
914 else
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
915 {
227
0e522484dd2a Import from CVS: tag r20-5b12
cvs
parents: 223
diff changeset
916 output_display_line (w, 0, cdla, line,
0e522484dd2a Import from CVS: tag r20-5b12
cvs
parents: 223
diff changeset
917 rect_draw.left, rect_draw.right);
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
918 }
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
919 }
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
920 }
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
921
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
922 f->windows_structure_changed = orig_windows_structure_changed;
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
923
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
924 /* If there have never been any face cache_elements created, then this
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
925 expose event doesn't actually have anything to do. */
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
926 if (Dynarr_largest (w->face_cachels))
227
0e522484dd2a Import from CVS: tag r20-5b12
cvs
parents: 223
diff changeset
927 redisplay_clear_bottom_of_window (w, cdla, rect_draw.top, rect_draw.bottom);
0e522484dd2a Import from CVS: tag r20-5b12
cvs
parents: 223
diff changeset
928
0e522484dd2a Import from CVS: tag r20-5b12
cvs
parents: 223
diff changeset
929 #ifdef HAVE_SCROLLBARS
0e522484dd2a Import from CVS: tag r20-5b12
cvs
parents: 223
diff changeset
930 mswindows_redisplay_deadbox_maybe (w, &rect_expose);
0e522484dd2a Import from CVS: tag r20-5b12
cvs
parents: 223
diff changeset
931 #endif
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
932 }
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
933
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
934 /*****************************************************************************
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
935 mswindows_redraw_exposed_windows
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
936
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
937 For each window beneath the given window in the window hierarchy,
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
938 ensure that it is redrawn if necessary after an Expose event.
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
939 ****************************************************************************/
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
940 static void
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
941 mswindows_redraw_exposed_windows (Lisp_Object window, int x, int y, int width,
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
942 int height)
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
943 {
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
944 for (; !NILP (window); window = XWINDOW (window)->next)
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
945 mswindows_redraw_exposed_window (XWINDOW (window), x, y, width, height);
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
946 }
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
947
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
948 /*****************************************************************************
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
949 mswindows_redraw_exposed_area
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
950
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
951 For each window on the given frame, ensure that any area in the
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
952 Exposed area is redrawn.
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
953 ****************************************************************************/
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
954 void
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
955 mswindows_redraw_exposed_area (struct frame *f, int x, int y, int width, int height)
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
956 {
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
957 /* If any window on the frame has had its face cache reset then the
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
958 redisplay structures are effectively invalid. If we attempt to
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
959 use them we'll blow up. We mark the frame as changed to ensure
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
960 that redisplay will do a full update. This probably isn't
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
961 necessary but it can't hurt. */
278
90d73dddcdc4 Import from CVS: tag r21-0b37
cvs
parents: 276
diff changeset
962 #ifdef HAVE_TOOLBARS
90d73dddcdc4 Import from CVS: tag r21-0b37
cvs
parents: 276
diff changeset
963 /* #### We would rather put these off as well but there is currently
90d73dddcdc4 Import from CVS: tag r21-0b37
cvs
parents: 276
diff changeset
964 no combination of flags which will force an unchanged toolbar to
90d73dddcdc4 Import from CVS: tag r21-0b37
cvs
parents: 276
diff changeset
965 redraw anyhow. */
90d73dddcdc4 Import from CVS: tag r21-0b37
cvs
parents: 276
diff changeset
966 MAYBE_FRAMEMETH (f, redraw_exposed_toolbars, (f, x, y, width, height));
90d73dddcdc4 Import from CVS: tag r21-0b37
cvs
parents: 276
diff changeset
967 #endif
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
968
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
969 if (!f->window_face_cache_reset)
215
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 213
diff changeset
970 {
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 213
diff changeset
971 mswindows_redraw_exposed_windows (f->root_window, x, y, width, height);
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 213
diff changeset
972 GdiFlush();
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 213
diff changeset
973 }
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
974 else
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
975 MARK_FRAME_CHANGED (f);
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
976 }
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
977
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
978
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
979 /*****************************************************************************
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
980 mswindows_bevel_modeline
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
981
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
982 Draw a 3d border around the modeline on window W.
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
983 ****************************************************************************/
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
984 static void
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
985 mswindows_bevel_modeline (struct window *w, struct display_line *dl)
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
986 {
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
987 struct frame *f = XFRAME (w->frame);
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
988 Lisp_Object color;
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
989 int shadow_width = MODELINE_SHADOW_THICKNESS (w);
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
990 RECT rect = { WINDOW_MODELINE_LEFT (w),
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
991 dl->ypos - dl->ascent - shadow_width,
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
992 WINDOW_MODELINE_RIGHT (w),
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
993 dl->ypos + dl->descent + shadow_width};
239
41f2f0e326e9 Import from CVS: tag r20-5b18
cvs
parents: 227
diff changeset
994 UINT edge;
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
995
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
996 color = WINDOW_FACE_CACHEL_BACKGROUND (w, MODELINE_INDEX);
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
997 mswindows_update_dc (FRAME_MSWINDOWS_DC (f), Qnil, Qnil, color, Qnil);
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
998
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
999 if (XINT (w->modeline_shadow_thickness) < 0)
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1000 shadow_width = -shadow_width;
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1001
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1002 if (shadow_width < -1)
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1003 edge = EDGE_SUNKEN;
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1004 else if (shadow_width < 0)
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1005 edge = BDR_SUNKENINNER;
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1006 else if (shadow_width == 1)
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1007 edge = BDR_RAISEDINNER;
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1008 else
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1009 edge = EDGE_RAISED;
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1010
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1011 DrawEdge (FRAME_MSWINDOWS_DC (f), &rect, edge, BF_RECT);
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1012 }
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1013
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1014
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1015 /*****************************************************************************
284
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
1016 Display methods
245
51092a27c943 Import from CVS: tag r20-5b21
cvs
parents: 239
diff changeset
1017 *****************************************************************************/
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1018
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1019 /*****************************************************************************
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1020 mswindows_divider_height
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1021
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1022 Return the height of the horizontal divider.
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1023 ****************************************************************************/
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1024 static int
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1025 mswindows_divider_height (void)
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1026 {
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1027 return 1; /* XXX Copied from redisplay-X.c. What is this? */
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1028 }
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1029
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1030 /*****************************************************************************
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1031 mswindows_eol_cursor_width
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1032
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1033 Return the width of the end-of-line cursor.
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1034 ****************************************************************************/
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1035 static int
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1036 mswindows_eol_cursor_width (void)
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1037 {
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1038 return MSWINDOWS_EOL_CURSOR_WIDTH;
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1039 }
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1040
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1041 /*****************************************************************************
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1042 mswindows_output_begin
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1043
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1044 Perform any necessary initialization prior to an update.
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1045 ****************************************************************************/
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1046 static void
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1047 mswindows_output_begin (struct device *d)
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1048 {
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1049 }
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1050
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1051 /*****************************************************************************
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1052 mswindows_output_end
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1053
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1054 Perform any necessary flushing of queues when an update has completed.
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1055 ****************************************************************************/
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1056 static void
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1057 mswindows_output_end (struct device *d)
410
de805c49cfc1 Import from CVS: tag r21-2-35
cvs
parents: 408
diff changeset
1058 {
de805c49cfc1 Import from CVS: tag r21-2-35
cvs
parents: 408
diff changeset
1059 GdiFlush();
de805c49cfc1 Import from CVS: tag r21-2-35
cvs
parents: 408
diff changeset
1060 }
de805c49cfc1 Import from CVS: tag r21-2-35
cvs
parents: 408
diff changeset
1061
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1062 static int
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1063 mswindows_flash (struct device *d)
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1064 {
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1065 struct frame *f = device_selected_frame (d);
239
41f2f0e326e9 Import from CVS: tag r20-5b18
cvs
parents: 227
diff changeset
1066 RECT rc;
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1067
239
41f2f0e326e9 Import from CVS: tag r20-5b18
cvs
parents: 227
diff changeset
1068 GetClientRect (FRAME_MSWINDOWS_HANDLE (f), &rc);
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1069 InvertRect (FRAME_MSWINDOWS_DC (f), &rc);
239
41f2f0e326e9 Import from CVS: tag r20-5b18
cvs
parents: 227
diff changeset
1070 GdiFlush ();
41f2f0e326e9 Import from CVS: tag r20-5b18
cvs
parents: 227
diff changeset
1071 Sleep (25);
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1072 InvertRect (FRAME_MSWINDOWS_DC (f), &rc);
239
41f2f0e326e9 Import from CVS: tag r20-5b18
cvs
parents: 227
diff changeset
1073
41f2f0e326e9 Import from CVS: tag r20-5b18
cvs
parents: 227
diff changeset
1074 return 1;
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1075 }
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1076
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1077 static void
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1078 mswindows_ring_bell (struct device *d, int volume, int pitch, int duration)
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1079 {
223
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 215
diff changeset
1080 /* Beep does not work at all, anyways! -kkm */
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 215
diff changeset
1081 MessageBeep (MB_OK);
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1082 }
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1083
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1084 /*****************************************************************************
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1085 mswindows_output_display_block
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1086
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1087 Given a display line, a block number for that start line, output all
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1088 runes between start and end in the specified display block.
380
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 294
diff changeset
1089 Ripped off with minimal thought from the corresponding X routine.
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1090 ****************************************************************************/
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1091 static void
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1092 mswindows_output_display_block (struct window *w, struct display_line *dl, int block,
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1093 int start, int end, int start_pixpos, int cursor_start,
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1094 int cursor_width, int cursor_height)
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1095 {
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1096 struct frame *f = XFRAME (w->frame);
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1097 Emchar_dynarr *buf = Dynarr_new (Emchar);
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1098 Lisp_Object window;
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1099
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1100 struct display_block *db = Dynarr_atp (dl->display_blocks, block);
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1101 rune_dynarr *rba = db->runes;
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1102 struct rune *rb;
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1103
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1104 int elt = start;
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1105 face_index findex;
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1106 int xpos, width;
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1107 Lisp_Object charset = Qunbound; /* Qnil is a valid charset when
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1108 MULE is not defined */
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1109 XSETWINDOW (window, w);
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1110 rb = Dynarr_atp (rba, start);
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1111
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1112 if (!rb)
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1113 {
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1114 /* Nothing to do so don't do anything. */
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1115 return;
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1116 }
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1117 else
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1118 {
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1119 findex = rb->findex;
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1120 xpos = rb->xpos;
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1121 width = 0;
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1122 if (rb->type == RUNE_CHAR)
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1123 charset = CHAR_CHARSET (rb->object.chr.ch);
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1124 }
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1125
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1126 if (end < 0)
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1127 end = Dynarr_length (rba);
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1128 Dynarr_reset (buf);
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1129
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1130 while (elt < end)
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1131 {
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1132 rb = Dynarr_atp (rba, elt);
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1133
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1134 if (rb->findex == findex && rb->type == RUNE_CHAR
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1135 && rb->object.chr.ch != '\n' && rb->cursor_type != CURSOR_ON
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1136 && EQ (charset, CHAR_CHARSET (rb->object.chr.ch)))
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1137 {
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1138 Dynarr_add (buf, rb->object.chr.ch);
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1139 width += rb->width;
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1140 elt++;
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1141 }
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1142 else
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1143 {
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1144 if (Dynarr_length (buf))
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1145 {
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1146 mswindows_output_string (w, dl, buf, xpos, 0, start_pixpos, width,
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1147 findex);
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1148 xpos = rb->xpos;
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1149 width = 0;
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1150 }
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1151 Dynarr_reset (buf);
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1152 width = 0;
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1153
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1154 if (rb->type == RUNE_CHAR)
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1155 {
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1156 findex = rb->findex;
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1157 xpos = rb->xpos;
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1158 charset = CHAR_CHARSET (rb->object.chr.ch);
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1159
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1160 if (rb->cursor_type == CURSOR_ON)
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1161 {
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1162 if (rb->object.chr.ch == '\n')
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1163 {
269
b2472a1930f2 Import from CVS: tag r20-5b33
cvs
parents: 267
diff changeset
1164 mswindows_output_cursor (w, dl, xpos, cursor_width,
b2472a1930f2 Import from CVS: tag r20-5b33
cvs
parents: 267
diff changeset
1165 findex, 0, 0);
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1166 }
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1167 else
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1168 {
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1169 Dynarr_add (buf, rb->object.chr.ch);
269
b2472a1930f2 Import from CVS: tag r20-5b33
cvs
parents: 267
diff changeset
1170 mswindows_output_cursor (w, dl, xpos, cursor_width,
b2472a1930f2 Import from CVS: tag r20-5b33
cvs
parents: 267
diff changeset
1171 findex, rb->object.chr.ch, 0);
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1172 Dynarr_reset (buf);
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1173 }
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1174
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1175 xpos += rb->width;
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1176 elt++;
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1177 }
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1178 else if (rb->object.chr.ch == '\n')
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1179 {
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1180 /* Clear in case a cursor was formerly here. */
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1181 int height = DISPLAY_LINE_HEIGHT (dl);
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1182
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1183 redisplay_clear_region (window, findex, xpos, dl->ypos - dl->ascent,
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1184 rb->width, height);
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1185 elt++;
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1186 }
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1187 }
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1188 else if (rb->type == RUNE_BLANK || rb->type == RUNE_HLINE)
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1189 {
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1190 if (rb->type == RUNE_BLANK)
280
7df0dd720c89 Import from CVS: tag r21-0b38
cvs
parents: 278
diff changeset
1191 mswindows_output_blank (w, dl, rb, start_pixpos);
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1192 else
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1193 {
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1194 /* #### Our flagging of when we need to redraw the
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1195 modeline shadows sucks. Since RUNE_HLINE is only used
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1196 by the modeline at the moment it is a good bet
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1197 that if it gets redrawn then we should also
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1198 redraw the shadows. This won't be true forever.
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1199 We borrow the shadow_thickness_changed flag for
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1200 now. */
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1201 w->shadow_thickness_changed = 1;
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1202 mswindows_output_hline (w, dl, rb);
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1203 }
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1204
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1205 if (rb->cursor_type == CURSOR_ON)
269
b2472a1930f2 Import from CVS: tag r20-5b33
cvs
parents: 267
diff changeset
1206 mswindows_output_cursor (w, dl, xpos, cursor_width, rb->findex, 0, 0);
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1207
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1208 elt++;
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1209 if (elt < end)
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1210 {
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1211 rb = Dynarr_atp (rba, elt);
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1212
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1213 findex = rb->findex;
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1214 xpos = rb->xpos;
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1215 }
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1216 }
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1217 else if (rb->type == RUNE_DGLYPH)
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1218 {
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1219 Lisp_Object instance;
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1220
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1221 XSETWINDOW (window, w);
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1222 instance = glyph_image_instance (rb->object.dglyph.glyph,
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1223 window, ERROR_ME_NOT, 1);
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1224 findex = rb->findex;
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1225
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1226 if (IMAGE_INSTANCEP (instance))
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1227 switch (XIMAGE_INSTANCE_TYPE (instance))
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1228 {
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1229 case IMAGE_TEXT:
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1230 {
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1231 /* #### This is way losing. See the comment in
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1232 add_glyph_rune(). */
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1233 Lisp_Object string =
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1234 XIMAGE_INSTANCE_TEXT_STRING (instance);
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1235 convert_bufbyte_string_into_emchar_dynarr
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1236 (XSTRING_DATA (string), XSTRING_LENGTH (string), buf);
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1237
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1238 if (rb->cursor_type == CURSOR_ON)
269
b2472a1930f2 Import from CVS: tag r20-5b33
cvs
parents: 267
diff changeset
1239 mswindows_output_cursor (w, dl, xpos, cursor_width,
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1240 findex, Dynarr_at (buf, 0), 0);
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1241 else /* #### redisplay-x passes -1 as the width: why ? */
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1242 mswindows_output_string (w, dl, buf, xpos,
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1243 rb->object.dglyph.xoffset,
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1244 start_pixpos, rb->width, findex);
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1245 Dynarr_reset (buf);
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1246 }
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1247 break;
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1248
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1249 case IMAGE_MONO_PIXMAP:
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1250 case IMAGE_COLOR_PIXMAP:
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1251 mswindows_output_pixmap (w, dl, instance, xpos,
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1252 rb->object.dglyph.xoffset, start_pixpos,
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1253 rb->width, findex, cursor_start,
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1254 cursor_width, cursor_height, 0);
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1255 if (rb->cursor_type == CURSOR_ON)
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1256 mswindows_output_cursor (w, dl, xpos, cursor_width,
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1257 findex, 0, 1);
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1258 break;
406
b8cc9ab3f761 Import from CVS: tag r21-2-33
cvs
parents: 404
diff changeset
1259
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1260 case IMAGE_POINTER:
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1261 abort ();
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1262
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1263 case IMAGE_SUBWINDOW:
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1264 case IMAGE_WIDGET:
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1265 redisplay_output_subwindow (w, dl, instance, xpos,
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1266 rb->object.dglyph.xoffset, start_pixpos,
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1267 rb->width, findex, cursor_start,
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1268 cursor_width, cursor_height);
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1269 if (rb->cursor_type == CURSOR_ON)
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1270 mswindows_output_cursor (w, dl, xpos, cursor_width,
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1271 findex, 0, 1);
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1272 break;
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1273
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1274 case IMAGE_NOTHING:
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1275 /* nothing is as nothing does */
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1276 break;
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1277
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1278 default:
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1279 abort ();
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1280 }
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1281
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1282 xpos += rb->width;
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1283 elt++;
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1284 }
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1285 else
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1286 abort ();
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1287 }
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1288 }
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1289
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1290 if (Dynarr_length (buf))
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1291 mswindows_output_string (w, dl, buf, xpos, 0, start_pixpos, width, findex);
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1292
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1293 if (dl->modeline
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1294 && !EQ (Qzero, w->modeline_shadow_thickness)
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1295 && (f->clear
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1296 || f->windows_structure_changed
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1297 || w->shadow_thickness_changed))
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1298 mswindows_bevel_modeline (w, dl);
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1299
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1300 Dynarr_free (buf);
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1301 }
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1302
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1303
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1304 /*****************************************************************************
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1305 mswindows_output_vertical_divider
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1306
284
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
1307 Draw a vertical divider down the right side of the given window.
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1308 ****************************************************************************/
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1309 static void
284
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
1310 mswindows_output_vertical_divider (struct window *w, int clear_unused)
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1311 {
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1312 struct frame *f = XFRAME (w->frame);
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1313 RECT rect;
284
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
1314 int spacing = XINT (w->vertical_divider_spacing);
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
1315 int shadow = XINT (w->vertical_divider_shadow_thickness);
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
1316 int abs_shadow = abs (shadow);
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
1317 int line_width = XINT (w->vertical_divider_line_width);
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
1318 int div_left = WINDOW_RIGHT (w) - window_divider_width (w);
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1319
284
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
1320 /* Clear left and right spacing areas */
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
1321 if (spacing)
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
1322 {
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1323 rect.top = WINDOW_TOP (w);
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1324 rect.bottom = WINDOW_BOTTOM (w);
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1325 mswindows_update_dc (FRAME_MSWINDOWS_DC (f), Qnil, Qnil,
284
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
1326 WINDOW_FACE_CACHEL_BACKGROUND (w, DEFAULT_INDEX), Qnil);
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
1327 rect.right = WINDOW_RIGHT (w);
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
1328 rect.left = rect.right - spacing;
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1329 ExtTextOut (FRAME_MSWINDOWS_DC (f), 0, 0, ETO_OPAQUE,
284
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
1330 &rect, NULL, 0, NULL);
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
1331 rect.left = div_left;
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
1332 rect.right = div_left + spacing;
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1333 ExtTextOut (FRAME_MSWINDOWS_DC (f), 0, 0, ETO_OPAQUE,
284
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
1334 &rect, NULL, 0, NULL);
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
1335 }
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
1336
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
1337 /* Clear divider face */
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1338 rect.top = WINDOW_TOP (w) + abs_shadow;
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1339 rect.bottom = WINDOW_BOTTOM (w) - abs_shadow;
284
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
1340 rect.left = div_left + spacing + abs_shadow;
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
1341 rect.right = rect.left + line_width;
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
1342 if (rect.left < rect.right)
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
1343 {
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
1344 face_index div_face
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
1345 = get_builtin_face_cache_index (w, Vvertical_divider_face);
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1346 mswindows_update_dc (FRAME_MSWINDOWS_DC (f), Qnil, Qnil,
284
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
1347 WINDOW_FACE_CACHEL_BACKGROUND (w, div_face), Qnil);
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1348 ExtTextOut (FRAME_MSWINDOWS_DC (f), 0, 0, ETO_OPAQUE,
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1349 &rect, NULL, 0, NULL);
284
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
1350 }
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1351
284
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
1352 /* Draw a shadow around the divider */
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
1353 if (shadow != 0)
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
1354 {
380
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 294
diff changeset
1355 /* #### This will be fixed to support arbitrary thickness */
284
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
1356 InflateRect (&rect, abs_shadow, abs_shadow);
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1357 DrawEdge (FRAME_MSWINDOWS_DC (f), &rect,
284
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
1358 shadow > 0 ? EDGE_RAISED : EDGE_SUNKEN, BF_RECT);
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
1359 }
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1360 }
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1361
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1362 /****************************************************************************
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1363 mswindows_text_width
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1364
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1365 Given a string and a face, return the string's length in pixels when
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1366 displayed in the font associated with the face.
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1367 ****************************************************************************/
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1368 static int
251
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 249
diff changeset
1369 mswindows_text_width (struct frame *f, struct face_cachel *cachel,
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1370 CONST Emchar *str, Charcount len)
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1371 {
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1372 int width_so_far = 0;
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1373 unsigned char *text_storage = (unsigned char *) alloca (2 * len);
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1374 textual_run *runs = alloca_array (textual_run, len);
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1375 int nruns;
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1376 int i;
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1377
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1378 nruns = separate_textual_runs (text_storage, runs, str, len);
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1379
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1380 for (i = 0; i < nruns; i++)
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1381 width_so_far += mswindows_text_width_single_run (FRAME_MSWINDOWS_DC (f),
251
677f6a0ee643 Import from CVS: tag r20-5b24
cvs
parents: 249
diff changeset
1382 cachel, runs + i);
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1383
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1384 return width_so_far;
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1385 }
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1386
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1387
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1388 /****************************************************************************
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1389 mswindows_clear_region
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1390
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1391 Clear the area in the box defined by the given parameters using the
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1392 given face.
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1393 ****************************************************************************/
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1394 static void
384
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1395 mswindows_clear_region (Lisp_Object locale, struct device* d, struct frame* f,
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1396 face_index findex, int x, int y,
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1397 int width, int height, Lisp_Object fcolor, Lisp_Object bcolor,
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1398 Lisp_Object background_pixmap)
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1399 {
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1400 RECT rect = { x, y, x+width, y+height };
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1401
384
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1402 if (!NILP (background_pixmap))
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1403 {
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1404 mswindows_update_dc (FRAME_MSWINDOWS_DC (f),
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1405 Qnil, fcolor, bcolor, background_pixmap);
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1406
288
e11d67e05968 Import from CVS: tag r21-0b42
cvs
parents: 286
diff changeset
1407 mswindows_output_dibitmap_region
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1408 ( f, XIMAGE_INSTANCE (background_pixmap),
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1409 x, y, 0, 0, 0, 0, width, height, 0, TRUE);
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1410 }
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1411 else
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1412 {
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1413 mswindows_update_dc (FRAME_MSWINDOWS_DC (f), Qnil, Qnil, fcolor, Qnil);
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1414 ExtTextOut (FRAME_MSWINDOWS_DC (f), 0, 0, ETO_OPAQUE,
384
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1415 &rect, NULL, 0, NULL);
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1416 }
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1417
227
0e522484dd2a Import from CVS: tag r20-5b12
cvs
parents: 223
diff changeset
1418 #ifdef HAVE_SCROLLBARS
0e522484dd2a Import from CVS: tag r20-5b12
cvs
parents: 223
diff changeset
1419 if (WINDOWP (locale))
384
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents: 380
diff changeset
1420 mswindows_redisplay_deadbox_maybe (XWINDOW (locale), &rect);
227
0e522484dd2a Import from CVS: tag r20-5b12
cvs
parents: 223
diff changeset
1421 #endif
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1422 }
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1423
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1424 /*****************************************************************************
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1425 mswindows_clear_to_window_end
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1426
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1427 Clear the area between ypos1 and ypos2. Each margin area and the
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1428 text area is handled separately since they may each have their own
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1429 background color.
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1430 ****************************************************************************/
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1431 static void
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1432 mswindows_clear_to_window_end (struct window *w, int ypos1, int ypos2)
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1433 {
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1434 int height = ypos2 - ypos1;
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1435
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1436 if (height)
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1437 {
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1438 struct frame *f = XFRAME (w->frame);
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1439 Lisp_Object window;
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1440 int bflag = (window_needs_vertical_divider (w) ? 0 : 1);
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1441 layout_bounds bounds;
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1442
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1443 bounds = calculate_display_line_boundaries (w, bflag);
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1444 XSETWINDOW (window, w);
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1445
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1446 if (window_is_leftmost (w))
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1447 redisplay_clear_region (window, DEFAULT_INDEX, FRAME_LEFT_BORDER_START (f),
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1448 ypos1, FRAME_BORDER_WIDTH (f), height);
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1449
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1450 if (bounds.left_in - bounds.left_out > 0)
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1451 redisplay_clear_region (window,
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1452 get_builtin_face_cache_index (w, Vleft_margin_face),
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1453 bounds.left_out, ypos1,
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1454 bounds.left_in - bounds.left_out, height);
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1455
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1456 if (bounds.right_in - bounds.left_in > 0)
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1457 redisplay_clear_region (window, DEFAULT_INDEX, bounds.left_in, ypos1,
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1458 bounds.right_in - bounds.left_in, height);
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1459
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1460 if (bounds.right_out - bounds.right_in > 0)
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1461 redisplay_clear_region (window,
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1462 get_builtin_face_cache_index (w, Vright_margin_face),
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1463 bounds.right_in, ypos1,
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1464 bounds.right_out - bounds.right_in, height);
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1465
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1466 if (window_is_rightmost (w))
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1467 redisplay_clear_region (window, DEFAULT_INDEX, FRAME_RIGHT_BORDER_START (f),
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1468 ypos1, FRAME_BORDER_WIDTH (f), height);
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1469 }
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1470
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1471 }
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1472
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1473
215
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 213
diff changeset
1474 /* XXX Implement me! */
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1475 static void
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1476 mswindows_clear_frame (struct frame *f)
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1477 {
215
1f0dabaa0855 Import from CVS: tag r20-4b6
cvs
parents: 213
diff changeset
1478 GdiFlush();
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1479 }
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1480
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1481
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1482
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1483 /************************************************************************/
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1484 /* initialization */
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1485 /************************************************************************/
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1486
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1487 void
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1488 console_type_create_redisplay_mswindows (void)
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1489 {
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1490 /* redisplay methods */
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1491 CONSOLE_HAS_METHOD (mswindows, text_width);
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1492 CONSOLE_HAS_METHOD (mswindows, output_display_block);
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1493 CONSOLE_HAS_METHOD (mswindows, divider_height);
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1494 CONSOLE_HAS_METHOD (mswindows, eol_cursor_width);
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1495 CONSOLE_HAS_METHOD (mswindows, output_vertical_divider);
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1496 CONSOLE_HAS_METHOD (mswindows, clear_to_window_end);
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1497 CONSOLE_HAS_METHOD (mswindows, clear_region);
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1498 CONSOLE_HAS_METHOD (mswindows, clear_frame);
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1499 CONSOLE_HAS_METHOD (mswindows, output_begin);
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 410
diff changeset
1500 CONSOLE_HAS_METHOD (mswindows, output_end);
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1501 CONSOLE_HAS_METHOD (mswindows, flash);
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1502 CONSOLE_HAS_METHOD (mswindows, ring_bell);
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1503 }