comparison src/redisplay-xlike-inc.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 37fb945697f5
children cb65bfaf7110 574f0cded429
comparison
equal deleted inserted replaced
5627:37fb945697f5 5628:81fee4aee9b6
515 Given a string and a merged face, return the string's length in pixels 515 Given a string and a merged face, return the string's length in pixels
516 when displayed in the fonts associated with the face. 516 when displayed in the fonts associated with the face.
517 */ 517 */
518 518
519 static int 519 static int
520 XLIKE_text_width (struct window *w, struct face_cachel *cachel, 520 XLIKE_text_width (struct frame *f, struct face_cachel *cachel,
521 const Ichar *str, Charcount len) 521 const Ichar *str, Charcount len)
522 { 522 {
523 /* !!#### Needs review */ 523 /* !!#### Needs review */
524 int width_so_far = 0; 524 int width_so_far = 0;
525 unsigned char *text_storage = (unsigned char *) ALLOCA (2 * len); 525 unsigned char *text_storage = (unsigned char *) ALLOCA (2 * len);
526 struct textual_run *runs = alloca_array (struct textual_run, len); 526 struct textual_run *runs = alloca_array (struct textual_run, len);
527 struct frame *f = XFRAME (w->frame); 527 XLIKE_DISPLAY dpy = GET_XLIKE_DISPLAY (XDEVICE (f->device));
528 struct device *d = XDEVICE (f->device);
529 XLIKE_DISPLAY dpy = GET_XLIKE_DISPLAY (d);
530 int nruns; 528 int nruns;
531 int i; 529 int i;
532 530
533 nruns = separate_textual_runs (text_storage, runs, str, len, 531 nruns = separate_textual_runs (text_storage, runs, str, len,
534 cachel); 532 cachel);
1038 xft_convert_color (dpy, cmap, visual, \ 1036 xft_convert_color (dpy, cmap, visual, \
1039 XCOLOR_INSTANCE_X_COLOR (color).pixel, (dim)) 1037 XCOLOR_INSTANCE_X_COLOR (color).pixel, (dim))
1040 #endif /* USE_XFT */ 1038 #endif /* USE_XFT */
1041 1039
1042 if (width < 0) 1040 if (width < 0)
1043 width = XLIKE_text_width (w, cachel, Dynarr_begin (buf), 1041 width = XLIKE_text_width (f, cachel, Dynarr_begin (buf),
1044 Dynarr_length (buf)); 1042 Dynarr_length (buf));
1045 1043
1046 /* Regularize the variables passed in. */ 1044 /* Regularize the variables passed in. */
1047 1045
1048 if (clip_start < xpos) 1046 if (clip_start < xpos)