comparison 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
comparison
equal deleted inserted replaced
4882:eab9498ecc0e 4928:ea701c23ed84
765 765
766 Given a string and a merged face, return the string's length in pixels 766 Given a string and a merged face, return the string's length in pixels
767 when displayed in the fonts associated with the face. 767 when displayed in the fonts associated with the face.
768 */ 768 */
769 769
770 /* #### Break me out into a separate header */ 770 static int
771 int XLIKE_text_width (struct frame *USED_IF_X (f), struct face_cachel *cachel, 771 XLIKE_text_width (struct window *w, struct face_cachel *cachel,
772 const Ichar *str, Charcount len);
773 int
774 XLIKE_text_width (struct frame *USED_IF_X (f), struct face_cachel *cachel,
775 const Ichar *str, Charcount len) 772 const Ichar *str, Charcount len)
776 { 773 {
777 /* !!#### Needs review */ 774 /* !!#### Needs review */
778 int width_so_far = 0; 775 int width_so_far = 0;
779 unsigned char *text_storage = (unsigned char *) ALLOCA (2 * len); 776 unsigned char *text_storage = (unsigned char *) ALLOCA (2 * len);
780 struct textual_run *runs = alloca_array (struct textual_run, len); 777 struct textual_run *runs = alloca_array (struct textual_run, len);
778 struct frame *f = WINDOW_XFRAME (w);
781 int nruns; 779 int nruns;
782 int i; 780 int i;
783 781
784 nruns = separate_textual_runs (text_storage, runs, str, len, 782 nruns = separate_textual_runs (text_storage, runs, str, len,
785 cachel); 783 cachel);
1269 COLOR_INSTANCE_X_COLOR (XCOLOR_INSTANCE (color)).pixel, \ 1267 COLOR_INSTANCE_X_COLOR (XCOLOR_INSTANCE (color)).pixel, \
1270 (dim)) 1268 (dim))
1271 #endif /* USE_XFT */ 1269 #endif /* USE_XFT */
1272 1270
1273 if (width < 0) 1271 if (width < 0)
1274 width = XLIKE_text_width (f, cachel, Dynarr_atp (buf, 0), 1272 width = XLIKE_text_width (w, cachel, Dynarr_atp (buf, 0),
1275 Dynarr_length (buf)); 1273 Dynarr_length (buf));
1276 1274
1277 /* Regularize the variables passed in. */ 1275 /* Regularize the variables passed in. */
1278 1276
1279 if (clip_start < xpos) 1277 if (clip_start < xpos)