comparison src/redisplay-x.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
447 instance = glyph_image_instance (rb->object.dglyph.glyph, 447 instance = glyph_image_instance (rb->object.dglyph.glyph,
448 window, ERROR_ME_NOT, 1); 448 window, ERROR_ME_NOT, 1);
449 findex = rb->findex; 449 findex = rb->findex;
450 450
451 if (IMAGE_INSTANCEP (instance)) 451 if (IMAGE_INSTANCEP (instance))
452 switch (XIMAGE_INSTANCE_TYPE (instance)) 452 {
453 { 453 switch (XIMAGE_INSTANCE_TYPE (instance))
454 case IMAGE_TEXT:
455 { 454 {
456 /* #### This is way losing. See the comment in 455 case IMAGE_TEXT:
457 add_glyph_rune(). */ 456 {
458 Lisp_Object string = 457 /* #### This is way losing. See the comment in
459 XIMAGE_INSTANCE_TEXT_STRING (instance); 458 add_glyph_rune(). */
460 convert_bufbyte_string_into_emchar_dynarr 459 Lisp_Object string =
461 (XSTRING_DATA (string), XSTRING_LENGTH (string), buf); 460 XIMAGE_INSTANCE_TEXT_STRING (instance);
462 461 convert_bufbyte_string_into_emchar_dynarr
463 x_output_string (w, dl, buf, xpos, 462 (XSTRING_DATA (string), XSTRING_LENGTH (string), buf);
464 rb->object.dglyph.xoffset, 463
465 start_pixpos, -1, findex, 464 x_output_string (w, dl, buf, xpos,
466 (rb->cursor_type == CURSOR_ON), 465 rb->object.dglyph.xoffset,
467 cursor_start, cursor_width, 466 start_pixpos, -1, findex,
468 cursor_height); 467 (rb->cursor_type == CURSOR_ON),
469 Dynarr_reset (buf); 468 cursor_start, cursor_width,
469 cursor_height);
470 Dynarr_reset (buf);
471 }
472 break;
473
474 case IMAGE_MONO_PIXMAP:
475 case IMAGE_COLOR_PIXMAP:
476 redisplay_output_pixmap (w, instance, &dbox, &dga, findex,
477 cursor_start, cursor_width,
478 cursor_height, 0);
479 break;
480
481 case IMAGE_WIDGET:
482 case IMAGE_SUBWINDOW:
483 redisplay_output_subwindow (w, instance, &dbox, &dga, findex,
484 cursor_start, cursor_width,
485 cursor_height);
486 break;
487
488 case IMAGE_LAYOUT:
489 redisplay_output_layout (w, instance, &dbox, &dga, findex,
490 cursor_start, cursor_width,
491 cursor_height);
492 break;
493
494 case IMAGE_NOTHING:
495 /* nothing is as nothing does */
496 break;
497
498 case IMAGE_POINTER:
499 default:
500 abort ();
470 } 501 }
471 break; 502 IMAGE_INSTANCE_OPTIMIZE_OUTPUT
472 503 (XIMAGE_INSTANCE (instance)) = 0;
473 case IMAGE_MONO_PIXMAP: 504 }
474 case IMAGE_COLOR_PIXMAP:
475 redisplay_output_pixmap (w, instance, &dbox, &dga, findex,
476 cursor_start, cursor_width,
477 cursor_height, 0);
478 break;
479
480 case IMAGE_WIDGET:
481 case IMAGE_SUBWINDOW:
482 redisplay_output_subwindow (w, instance, &dbox, &dga, findex,
483 cursor_start, cursor_width,
484 cursor_height);
485 break;
486
487 case IMAGE_LAYOUT:
488 redisplay_output_layout (w, instance, &dbox, &dga, findex,
489 cursor_start, cursor_width,
490 cursor_height);
491 break;
492
493 case IMAGE_NOTHING:
494 /* nothing is as nothing does */
495 break;
496
497 case IMAGE_POINTER:
498 default:
499 abort ();
500 }
501 505
502 xpos += rb->width; 506 xpos += rb->width;
503 elt++; 507 elt++;
504 } 508 }
505 else 509 else
680 /* evil kludge! */ 684 /* evil kludge! */
681 if (!NILP (fg) && !COLOR_INSTANCEP (fg) && !INTP (fg)) 685 if (!NILP (fg) && !COLOR_INSTANCEP (fg) && !INTP (fg))
682 { 686 {
683 /* #### I fixed once case where this was getting it. It was a 687 /* #### I fixed once case where this was getting it. It was a
684 bad macro expansion (compiler bug). */ 688 bad macro expansion (compiler bug). */
685 fprintf (stderr, "Help! x_get_gc got a bogus fg value! fg = "); 689 stderr_out ("Help! x_get_gc got a bogus fg value! fg = ");
686 debug_print (fg); 690 debug_print (fg);
687 fg = Qnil; 691 fg = Qnil;
688 } 692 }
689 693
690 if (!NILP (fg)) 694 if (!NILP (fg))
1318 width = window_divider_width (w); 1322 width = window_divider_width (w);
1319 shadow_thickness = XINT (w->vertical_divider_shadow_thickness); 1323 shadow_thickness = XINT (w->vertical_divider_shadow_thickness);
1320 spacing = XINT (w->vertical_divider_spacing); 1324 spacing = XINT (w->vertical_divider_spacing);
1321 line_width = XINT (w->vertical_divider_line_width); 1325 line_width = XINT (w->vertical_divider_line_width);
1322 x = WINDOW_RIGHT (w) - width; 1326 x = WINDOW_RIGHT (w) - width;
1323 y1 = WINDOW_TOP (w) + FRAME_TOP_GUTTER_BOUNDS (f); 1327 y1 = WINDOW_TOP (w);
1324 y2 = WINDOW_BOTTOM (w) + FRAME_BOTTOM_GUTTER_BOUNDS (f); 1328 y2 = WINDOW_BOTTOM (w);
1325 1329
1326 memset (&gcv, ~0, sizeof (XGCValues)); 1330 memset (&gcv, ~0, sizeof (XGCValues));
1327 1331
1328 tmp_pixel = WINDOW_FACE_CACHEL_BACKGROUND (w, div_face); 1332 tmp_pixel = WINDOW_FACE_CACHEL_BACKGROUND (w, div_face);
1329 tmp_color = COLOR_INSTANCE_X_COLOR (XCOLOR_INSTANCE (tmp_pixel)); 1333 tmp_color = COLOR_INSTANCE_X_COLOR (XCOLOR_INSTANCE (tmp_pixel));
1981 XColor tmp_fcolor, tmp_bcolor; 1985 XColor tmp_fcolor, tmp_bcolor;
1982 Lisp_Object tmp_pixel, frame; 1986 Lisp_Object tmp_pixel, frame;
1983 struct frame *f = device_selected_frame (d); 1987 struct frame *f = device_selected_frame (d);
1984 struct window *w = XWINDOW (FRAME_ROOT_WINDOW (f)); 1988 struct window *w = XWINDOW (FRAME_ROOT_WINDOW (f));
1985 Widget shell = FRAME_X_SHELL_WIDGET (f); 1989 Widget shell = FRAME_X_SHELL_WIDGET (f);
1990 int flash_height;
1986 1991
1987 XSETFRAME (frame, f); 1992 XSETFRAME (frame, f);
1988 1993
1989 tmp_pixel = FACE_FOREGROUND (Vdefault_face, frame); 1994 tmp_pixel = FACE_FOREGROUND (Vdefault_face, frame);
1990 tmp_fcolor = COLOR_INSTANCE_X_COLOR (XCOLOR_INSTANCE (tmp_pixel)); 1995 tmp_fcolor = COLOR_INSTANCE_X_COLOR (XCOLOR_INSTANCE (tmp_pixel));
1997 gcv.foreground = (tmp_fcolor.pixel ^ tmp_bcolor.pixel); 2002 gcv.foreground = (tmp_fcolor.pixel ^ tmp_bcolor.pixel);
1998 gcv.function = GXxor; 2003 gcv.function = GXxor;
1999 gcv.graphics_exposures = False; 2004 gcv.graphics_exposures = False;
2000 gc = gc_cache_lookup (DEVICE_X_GC_CACHE (XDEVICE (f->device)), &gcv, 2005 gc = gc_cache_lookup (DEVICE_X_GC_CACHE (XDEVICE (f->device)), &gcv,
2001 (GCForeground | GCFunction | GCGraphicsExposures)); 2006 (GCForeground | GCFunction | GCGraphicsExposures));
2002 XFillRectangle (dpy, win, gc, w->pixel_left, w->pixel_top, 2007 default_face_height_and_width (frame, &flash_height, 0);
2003 w->pixel_width, w->pixel_height); 2008
2009 /* If window is tall, flash top and bottom line. */
2010 if (EQ (Vvisible_bell, Qtop_bottom) && w->pixel_height > 3 * flash_height)
2011 {
2012 XFillRectangle (dpy, win, gc, w->pixel_left, w->pixel_top,
2013 w->pixel_width, flash_height);
2014 XFillRectangle (dpy, win, gc, w->pixel_left,
2015 w->pixel_top + w->pixel_height - flash_height,
2016 w->pixel_width, flash_height);
2017 }
2018 else
2019 /* If it is short, flash it all. */
2020 XFillRectangle (dpy, win, gc, w->pixel_left, w->pixel_top,
2021 w->pixel_width, w->pixel_height);
2022
2004 XSync (dpy, False); 2023 XSync (dpy, False);
2005 2024
2006 #ifdef HAVE_SELECT 2025 #ifdef HAVE_SELECT
2007 { 2026 {
2008 int usecs = 100000; 2027 int usecs = 100000;
2018 #else /* !HAVE_POLL */ 2037 #else /* !HAVE_POLL */
2019 bite me 2038 bite me
2020 #endif /* HAVE_POLL */ 2039 #endif /* HAVE_POLL */
2021 #endif /* HAVE_SELECT */ 2040 #endif /* HAVE_SELECT */
2022 2041
2023 XFillRectangle (dpy, win, gc, w->pixel_left, w->pixel_top, 2042 /* If window is tall, flash top and bottom line. */
2024 w->pixel_width, w->pixel_height); 2043 if (EQ (Vvisible_bell, Qtop_bottom) && w->pixel_height > 3 * flash_height)
2044 {
2045 XFillRectangle (dpy, win, gc, w->pixel_left, w->pixel_top,
2046 w->pixel_width, flash_height);
2047 XFillRectangle (dpy, win, gc, w->pixel_left,
2048 w->pixel_top + w->pixel_height - flash_height,
2049 w->pixel_width, flash_height);
2050 }
2051 else
2052 /* If it is short, flash it all. */
2053 XFillRectangle (dpy, win, gc, w->pixel_left, w->pixel_top,
2054 w->pixel_width, w->pixel_height);
2055
2025 XSync (dpy, False); 2056 XSync (dpy, False);
2026 2057
2027 return 1; 2058 return 1;
2028 } 2059 }
2029 2060