Mercurial > hg > xemacs-beta
comparison src/redisplay-tty.c @ 404:2f8bb876ab1d r21-2-32
Import from CVS: tag r21-2-32
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:16:07 +0200 |
parents | 74fd4e045ea6 |
children | b8cc9ab3f761 |
comparison
equal
deleted
inserted
replaced
403:9f011ab08d48 | 404:2f8bb876ab1d |
---|---|
331 XSETWINDOW (window, w); | 331 XSETWINDOW (window, w); |
332 instance = glyph_image_instance (rb->object.dglyph.glyph, | 332 instance = glyph_image_instance (rb->object.dglyph.glyph, |
333 window, ERROR_ME_NOT, 1); | 333 window, ERROR_ME_NOT, 1); |
334 | 334 |
335 if (IMAGE_INSTANCEP (instance)) | 335 if (IMAGE_INSTANCEP (instance)) |
336 switch (XIMAGE_INSTANCE_TYPE (instance)) | 336 { |
337 { | 337 switch (XIMAGE_INSTANCE_TYPE (instance)) |
338 case IMAGE_TEXT: | |
339 { | 338 { |
340 Bufbyte *temptemp; | 339 case IMAGE_TEXT: |
341 Lisp_Object string = | |
342 XIMAGE_INSTANCE_TEXT_STRING (instance); | |
343 Bytecount len = XSTRING_LENGTH (string); | |
344 | |
345 /* In the unlikely instance that a garbage-collect | |
346 occurs during encoding, we at least need to | |
347 copy the string. | |
348 */ | |
349 temptemp = (Bufbyte *) alloca (len); | |
350 memcpy (temptemp, XSTRING_DATA (string), len); | |
351 { | 340 { |
352 int i; | 341 Bufbyte *temptemp; |
353 | 342 Lisp_Object string = |
354 /* Now truncate the first rb->object.dglyph.xoffset | 343 XIMAGE_INSTANCE_TEXT_STRING (instance); |
355 columns. */ | 344 Bytecount len = XSTRING_LENGTH (string); |
356 for (i = 0; i < rb->object.dglyph.xoffset;) | 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)))) | |
357 { | 386 { |
358 #ifdef MULE | 387 cmgoto (f, dl->ypos - 1, cursor_start); |
359 Emchar ch = charptr_emchar (temptemp); | |
360 i += XCHARSET_COLUMNS (CHAR_CHARSET (ch)); | |
361 #else | |
362 i++; /* telescope this */ | |
363 #endif | |
364 INC_CHARPTR (temptemp); | |
365 } | 388 } |
366 | |
367 /* If we truncated one column too many, then | |
368 add a space at the beginning. */ | |
369 if (i > rb->object.dglyph.xoffset) | |
370 { | |
371 assert (i > 0); | |
372 *--temptemp = ' '; | |
373 i--; | |
374 } | |
375 len -= i; | |
376 } | 389 } |
377 | 390 break; |
378 tty_output_bufbyte_string (w, dl, temptemp, len, | 391 |
379 xpos, findex, 0); | 392 case IMAGE_MONO_PIXMAP: |
380 | 393 case IMAGE_COLOR_PIXMAP: |
381 if (xpos >= cursor_start | 394 case IMAGE_SUBWINDOW: |
382 && (cursor_start < | 395 case IMAGE_WIDGET: |
383 xpos + (bufbyte_string_displayed_columns | 396 case IMAGE_LAYOUT: |
384 (temptemp, len)))) | 397 /* just do nothing here */ |
385 { | 398 break; |
386 cmgoto (f, dl->ypos - 1, cursor_start); | 399 |
387 } | 400 case IMAGE_POINTER: |
401 abort (); | |
402 | |
403 case IMAGE_NOTHING: | |
404 /* nothing is as nothing does */ | |
405 break; | |
406 | |
407 default: | |
408 abort (); | |
388 } | 409 } |
389 break; | 410 IMAGE_INSTANCE_OPTIMIZE_OUTPUT |
390 | 411 (XIMAGE_INSTANCE (instance)) = 0; |
391 case IMAGE_MONO_PIXMAP: | 412 } |
392 case IMAGE_COLOR_PIXMAP: | |
393 case IMAGE_SUBWINDOW: | |
394 case IMAGE_WIDGET: | |
395 case IMAGE_LAYOUT: | |
396 /* just do nothing here */ | |
397 break; | |
398 | |
399 case IMAGE_POINTER: | |
400 abort (); | |
401 | |
402 case IMAGE_NOTHING: | |
403 /* nothing is as nothing does */ | |
404 break; | |
405 | |
406 default: | |
407 abort (); | |
408 } | |
409 | 413 |
410 xpos += rb->width; | 414 xpos += rb->width; |
411 elt++; | 415 elt++; |
412 } | 416 } |
413 else | 417 else |
564 #ifdef NOT_SURE | 568 #ifdef NOT_SURE |
565 internal_cursor_to (f, 0, 0); | 569 internal_cursor_to (f, 0, 0); |
566 clear_to_end (f); | 570 clear_to_end (f); |
567 #else | 571 #else |
568 /* #### Not implemented. */ | 572 /* #### Not implemented. */ |
569 fprintf (stderr, "Not yet.\n"); | 573 stderr_out ("Not yet.\n"); |
570 #endif | 574 #endif |
571 } | 575 } |
572 tty_turn_off_frame_face (f, Vdefault_face); | 576 tty_turn_off_frame_face (f, Vdefault_face); |
573 } | 577 } |
574 | 578 |