comparison src/redisplay-msw.c @ 5628:81fee4aee9b6

text_width methods interface cleanup. -------------------- ChangeLog entries follow: -------------------- src/ChangeLog addition: 2011-12-28 Didier Verna <didier@xemacs.org> * console-impl.h (struct console_methods): Have the text_width methods expect a frame instead of a window pointer. * console-stream.c (stream_text_width): * redisplay-msw.c (mswindows_text_width): * redisplay-tty.c (tty_text_width): * redisplay-xlike-inc.c (XLIKE_text_width): Update accordingly. * redisplay-msw.c (mswindows_output_string): * redisplay-xlike-inc.c (XLIKE_output_string): * redisplay.c (redisplay_window_text_width_ichar_string): * redisplay.c (redisplay_text_width_string): Update the callers. This also fixes an uncertainty about always getting a window from a domain.
author Didier Verna <didier@xemacs.org>
date Wed, 28 Dec 2011 11:21:38 +0100
parents c39052c921b5
children
comparison
equal deleted inserted replaced
5627:37fb945697f5 5628:81fee4aee9b6
465 window = wrap_window (w); 465 window = wrap_window (w);
466 466
467 #if 0 /* #### FIXME? */ 467 #if 0 /* #### FIXME? */
468 /* We can't work out the width before we've set the font in the DC */ 468 /* We can't work out the width before we've set the font in the DC */
469 if (width < 0) 469 if (width < 0)
470 width = mswindows_text_width (w, cachel, Dynarr_begin (buf), 470 width = mswindows_text_width (f, cachel, Dynarr_begin (buf),
471 Dynarr_length (buf)); 471 Dynarr_length (buf));
472 #else 472 #else
473 assert (width >= 0); 473 assert (width >= 0);
474 #endif 474 #endif
475 475
1210 1210
1211 Given a string and a face, return the string's length in pixels when 1211 Given a string and a face, return the string's length in pixels when
1212 displayed in the font associated with the face. 1212 displayed in the font associated with the face.
1213 ****************************************************************************/ 1213 ****************************************************************************/
1214 static int 1214 static int
1215 mswindows_text_width (struct window *w, struct face_cachel *cachel, 1215 mswindows_text_width (struct frame *f, struct face_cachel *cachel,
1216 const Ichar *str, Charcount len) 1216 const Ichar *str, Charcount len)
1217 { 1217 {
1218 struct frame *f = WINDOW_XFRAME (w);
1219 HDC hdc = get_frame_dc (f, 0); 1218 HDC hdc = get_frame_dc (f, 0);
1220 int width_so_far = 0; 1219 int width_so_far = 0;
1221 textual_run *runs; 1220 textual_run *runs;
1222 int nruns; 1221 int nruns;
1223 int i; 1222 int i;