diff src/redisplay-xlike-inc.c @ 4928:ea701c23ed84

change text_width method to take a window, in preparation for unicode-internal changes -------------------- ChangeLog entries follow: -------------------- src/ChangeLog addition: 2010-01-19 Ben Wing <ben@xemacs.org> * console-impl.h (struct console_methods): * console-stream.c (stream_text_width): * redisplay-msw.c (mswindows_output_string): * redisplay-msw.c (mswindows_text_width): * redisplay-tty.c (tty_text_width): * redisplay-xlike-inc.c (XLIKE_text_width): * redisplay-xlike-inc.c (XLIKE_output_string): * redisplay.c: * redisplay.c (redisplay_window_text_width_ichar_string): * redisplay.c (redisplay_text_width_string): Change the text_width method to take a window instead of a frame. Needed for Unicode-internal.
author Ben Wing <ben@xemacs.org>
date Tue, 19 Jan 2010 11:21:34 -0600
parents eab9498ecc0e
children e813cf16c015
line wrap: on
line diff
--- a/src/redisplay-xlike-inc.c	Mon Jan 18 08:44:49 2010 -0600
+++ b/src/redisplay-xlike-inc.c	Tue Jan 19 11:21:34 2010 -0600
@@ -767,17 +767,15 @@
    when displayed in the fonts associated with the face.
    */
 
-/* #### Break me out into a separate header */
-int XLIKE_text_width (struct frame *USED_IF_X (f), struct face_cachel *cachel,
-		      const Ichar *str, Charcount len);
-int
-XLIKE_text_width (struct frame *USED_IF_X (f), struct face_cachel *cachel,
+static int
+XLIKE_text_width (struct window *w, 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 = WINDOW_XFRAME (w);
   int nruns;
   int i;
 
@@ -1271,7 +1269,7 @@
 #endif /* USE_XFT */
 
   if (width < 0)
-    width = XLIKE_text_width (f, cachel, Dynarr_atp (buf, 0),
+    width = XLIKE_text_width (w, cachel, Dynarr_atp (buf, 0),
 			      Dynarr_length (buf));
 
   /* Regularize the variables passed in. */