comparison src/redisplay-tty.c @ 406:b8cc9ab3f761 r21-2-33

Import from CVS: tag r21-2-33
author cvs
date Mon, 13 Aug 2007 11:17:09 +0200
parents 2f8bb876ab1d
children 501cfd01ee6d
comparison
equal deleted inserted replaced
405:0e08f63c74d2 406:b8cc9ab3f761
334 334
335 if (IMAGE_INSTANCEP (instance)) 335 if (IMAGE_INSTANCEP (instance))
336 { 336 {
337 switch (XIMAGE_INSTANCE_TYPE (instance)) 337 switch (XIMAGE_INSTANCE_TYPE (instance))
338 { 338 {
339 case IMAGE_TEXT:
340 {
341 Bufbyte *temptemp;
342 Lisp_Object string =
343 XIMAGE_INSTANCE_TEXT_STRING (instance);
344 Bytecount len = XSTRING_LENGTH (string);
345
346 /* In the unlikely instance that a garbage-collect
347 occurs during encoding, we at least need to
348 copy the string.
349 */
350 temptemp = (Bufbyte *) alloca (len);
351 memcpy (temptemp, XSTRING_DATA (string), len);
352 {
353 int i;
354
355 /* Now truncate the first rb->object.dglyph.xoffset
356 columns. */
357 for (i = 0; i < rb->object.dglyph.xoffset;)
358 {
359 #ifdef MULE
360 Emchar ch = charptr_emchar (temptemp);
361 i += XCHARSET_COLUMNS (CHAR_CHARSET (ch));
362 #else
363 i++; /* telescope this */
364 #endif
365 INC_CHARPTR (temptemp);
366 }
367
368 /* If we truncated one column too many, then
369 add a space at the beginning. */
370 if (i > rb->object.dglyph.xoffset)
371 {
372 assert (i > 0);
373 *--temptemp = ' ';
374 i--;
375 }
376 len -= i;
377 }
378
379 tty_output_bufbyte_string (w, dl, temptemp, len,
380 xpos, findex, 0);
381
382 if (xpos >= cursor_start
383 && (cursor_start <
384 xpos + (bufbyte_string_displayed_columns
385 (temptemp, len))))
386 {
387 cmgoto (f, dl->ypos - 1, cursor_start);
388 }
389 }
390 break;
391
392 case IMAGE_MONO_PIXMAP: 339 case IMAGE_MONO_PIXMAP:
393 case IMAGE_COLOR_PIXMAP: 340 case IMAGE_COLOR_PIXMAP:
394 case IMAGE_SUBWINDOW: 341 case IMAGE_SUBWINDOW:
395 case IMAGE_WIDGET: 342 case IMAGE_WIDGET:
396 case IMAGE_LAYOUT: 343 case IMAGE_LAYOUT:
397 /* just do nothing here */ 344 /* just do nothing here */
398 break; 345 break;
399 346
400 case IMAGE_POINTER:
401 abort ();
402
403 case IMAGE_NOTHING: 347 case IMAGE_NOTHING:
404 /* nothing is as nothing does */ 348 /* nothing is as nothing does */
405 break; 349 break;
406 350
351 case IMAGE_TEXT:
352 case IMAGE_POINTER:
407 default: 353 default:
408 abort (); 354 abort ();
409 } 355 }
410 IMAGE_INSTANCE_OPTIMIZE_OUTPUT 356 IMAGE_INSTANCE_OPTIMIZE_OUTPUT
411 (XIMAGE_INSTANCE (instance)) = 0; 357 (XIMAGE_INSTANCE (instance)) = 0;