diff 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
line wrap: on
line diff
--- a/src/redisplay-xlike-inc.c	Wed Dec 28 10:53:38 2011 +0100
+++ b/src/redisplay-xlike-inc.c	Wed Dec 28 11:21:38 2011 +0100
@@ -517,16 +517,14 @@
    */
 
 static int
-XLIKE_text_width (struct window *w, struct face_cachel *cachel,
+XLIKE_text_width (struct frame *f, struct face_cachel *cachel,
 		  const Ichar *str, Charcount len)
 {
   /* !!#### Needs review */
   int width_so_far = 0;
   unsigned char *text_storage = (unsigned char *) ALLOCA (2 * len);
   struct textual_run *runs = alloca_array (struct textual_run, len);
-  struct frame *f = XFRAME (w->frame);
-  struct device *d = XDEVICE (f->device);
-  XLIKE_DISPLAY dpy = GET_XLIKE_DISPLAY (d);
+  XLIKE_DISPLAY dpy = GET_XLIKE_DISPLAY (XDEVICE (f->device));
   int nruns;
   int i;
 
@@ -1040,7 +1038,7 @@
 #endif /* USE_XFT */
 
   if (width < 0)
-    width = XLIKE_text_width (w, cachel, Dynarr_begin (buf),
+    width = XLIKE_text_width (f, cachel, Dynarr_begin (buf),
 			      Dynarr_length (buf));
 
   /* Regularize the variables passed in. */