comparison src/redisplay-xlike-inc.c @ 5080:5502045ec510

The background-placement face property. -------------------- ChangeLog entries follow: -------------------- lisp/ChangeLog addition: 2010-02-25 Didier Verna <didier@xemacs.org> The background-placement face property. * cl-macs.el (face-background-placement): New defsetf. * cus-face.el (custom-face-attributes): * faces.el (face-interactive): * faces.el (set-face-property): * faces.el (face-equal): * faces.el (init-other-random-faces): Update. * faces.el (face-background-placement): * faces.el (set-face-background-placement): * faces.el (face-background-placement-instance): * faces.el (face-background-placement-instance-p): * frame.el (set-frame-background-placement): * frame.el (frame-background-placement): * frame.el (frame-background-placement-instance): * objects.el (make-face-background-placement-specifier): New. man/ChangeLog addition: 2010-02-25 Didier Verna <didier@xemacs.org> The background-placement face property. * xemacs/custom.texi (Faces): Document it. src/ChangeLog addition: 2010-02-25 Didier Verna <didier@xemacs.org> The background-placement face property. * console-x-impl.h (struct x_frame): Add new slots x and y. * console-x-impl.h (FRAME_X_X, FRAME_X_Y): New slot accessors. * console-gtk-impl.h: Fake something similar for potential port. * frame-x.c (x_get_frame_text_position): New function. * frame-x.c (x_init_frame_3): Use it. * event-Xt.c (emacs_Xt_handle_magic_event): Eat spurious ConfigureNotify events, get the frame position and mark frame faces changed. * objects-impl.h: The face_background_placement_specifier structure and its accessors. * objects.c: New symbols Qabsolute and Qrelative. * objects.c (face_background_placement_create): * objects.c (face_background_placement_mark): * objects.c (face_background_placement_instantiate): * objects.c (face_background_placement_validate): * objects.c (face_background_placement_after_change): * objects.c (set_face_background_placement_attached_to): New. * objects.h (set_face_background_palcement_attached_to): Declare the one above. * objects.c (syms_of_objects): * objects.c (specifier_type_create_objects): * objects.c (reinit_specifier_type_create_objects): * objects.c (reinit_vars_of_objects): Update for the modifications above. * console-xlike-inc.h (XLIKE_GC_TS_X_ORIGIN, XLIKE_GC_TS_X_ORIGIN): New X11/Gtk compatibility macros. * redisplay-xlike-inc.c (XLIKE_get_gc): Add a background placement argument and handle it. * gtk-glue.c (face_to_gc): * redisplay-xlike-inc.c (XLIKE_output_string): * redisplay-xlike-inc.c (XLIKE_output_pixmap): * redisplay-xlike-inc.c (XLIKE_output_blank): * redisplay-xlike-inc.c (XLIKE_output_horizontal_line): * redisplay-xlike-inc.c (XLIKE_output_eol_cursor): Update accordingly. * console-impl.h (struct console_methods): Add a background placement (Lisp_Object) argument to the clear_region method. * console-stream.c (stream_clear_region): * redisplay-tty.c (tty_clear_region): * redisplay-msw.c (mswindows_clear_region): * redisplay-xlike-inc.c (XLIKE_clear_region): Update accordingly. * redisplay-output.c (redisplay_clear_region): Handle the background placement property and update the call to the clear_region method. * faces.h (struct Lisp_Face): * faces.h (struct face_cachel): Add a background placement slot. * faces.h (WINDOW_FACE_CACHEL_BACKGROUND_PLACEMENT): New accessor. * faces.c (mark_face): * faces.c (face_equal): * faces.c (face_getprop): * faces.c (face_putprop): * faces.c (face_remprop): * faces.c (face_plist): * faces.c (reset_face): * faces.c (mark_face_cachels): * faces.c (update_face_cachel_data): * faces.c (merge_face_cachel_data): * faces.c (reset_face_cachel): * faces.c (Fmake_face): * faces.c (Fcopy_face): Handle the background placement property. * faces.c (syms_of_faces): * faces.c (vars_of_faces): * faces.c (complex_vars_of_faces): Update accordingly.
author Didier Verna <didier@lrde.epita.fr>
date Thu, 25 Feb 2010 16:19:01 +0100
parents 8af6a32b170d
children 0ca81354c4c7
comparison
equal deleted inserted replaced
5079:aa4cae427255 5080:5502045ec510
1 /* Common code between X and GTK -- redisplay-related. 1 /* Common code between X and GTK -- redisplay-related.
2 Copyright (C) 1994, 1995 Board of Trustees, University of Illinois. 2 Copyright (C) 1994, 1995 Board of Trustees, University of Illinois.
3 Copyright (C) 1994 Lucid, Inc. 3 Copyright (C) 1994 Lucid, Inc.
4 Copyright (C) 1995 Sun Microsystems, Inc. 4 Copyright (C) 1995 Sun Microsystems, Inc.
5 Copyright (C) 2002, 2003, 2005, 2009, 2010 Ben Wing. 5 Copyright (C) 2002, 2003, 2005, 2009, 2010 Ben Wing.
6 Copyright (C) 2010 Didier Verna
6 7
7 This file is part of XEmacs. 8 This file is part of XEmacs.
8 9
9 XEmacs is free software; you can redistribute it and/or modify it 10 XEmacs is free software; you can redistribute it and/or modify it
10 under the terms of the GNU General Public License as published by the 11 under the terms of the GNU General Public License as published by the
810 Dynarr_free (buf); 811 Dynarr_free (buf);
811 } 812 }
812 813
813 /* Called as gtk_get_gc from gtk-glue.c */ 814 /* Called as gtk_get_gc from gtk-glue.c */
814 815
815 XLIKE_GC XLIKE_get_gc (struct frame *f, Lisp_Object font, Lisp_Object fg, 816 XLIKE_GC XLIKE_get_gc (struct frame *f, Lisp_Object font,
816 Lisp_Object bg, Lisp_Object bg_pmap, 817 Lisp_Object fg, Lisp_Object bg,
818 Lisp_Object bg_pixmap, Lisp_Object bg_placement,
817 Lisp_Object lwidth); 819 Lisp_Object lwidth);
818 820
819 /***************************************************************************** 821 /*****************************************************************************
820 XLIKE_get_gc 822 XLIKE_get_gc
821 823
822 Given a number of parameters return a GC with those properties. 824 Given a number of parameters return a GC with those properties.
823 ****************************************************************************/ 825 ****************************************************************************/
824 XLIKE_GC 826 XLIKE_GC
825 XLIKE_get_gc (struct frame *f, Lisp_Object font, Lisp_Object fg, 827 XLIKE_get_gc (struct frame *f, Lisp_Object font,
826 Lisp_Object bg, Lisp_Object bg_pmap, Lisp_Object lwidth) 828 Lisp_Object fg, Lisp_Object bg,
829 Lisp_Object bg_pixmap, Lisp_Object bg_placement,
830 Lisp_Object lwidth)
827 { 831 {
828 struct device *d = XDEVICE (f->device); 832 struct device *d = XDEVICE (f->device);
829 XLIKE_GCVALUES gcv; 833 XLIKE_GCVALUES gcv;
830 unsigned long mask; 834 unsigned long mask;
831 835
835 the GC returned by this function. */ 839 the GC returned by this function. */
836 gcv.clip_mask = XLIKE_NONE; 840 gcv.clip_mask = XLIKE_NONE;
837 gcv.clip_x_origin = 0; 841 gcv.clip_x_origin = 0;
838 gcv.clip_y_origin = 0; 842 gcv.clip_y_origin = 0;
839 XLIKE_SET_GC_FILL (gcv, XLIKE_FILL_SOLID); 843 XLIKE_SET_GC_FILL (gcv, XLIKE_FILL_SOLID);
840 mask = XLIKE_GC_EXPOSURES | XLIKE_GC_CLIP_MASK | XLIKE_GC_CLIP_X_ORIGIN | XLIKE_GC_CLIP_Y_ORIGIN; 844 mask = XLIKE_GC_EXPOSURES
845 | XLIKE_GC_CLIP_MASK | XLIKE_GC_CLIP_X_ORIGIN | XLIKE_GC_CLIP_Y_ORIGIN;
841 mask |= XLIKE_GC_FILL; 846 mask |= XLIKE_GC_FILL;
842 847
843 if (!NILP (font) 848 if (!NILP (font)
844 #ifdef USE_XFT 849 #ifdef USE_XFT
845 /* Only set the font if it's a core font */ 850 /* Only set the font if it's a core font */
881 mask |= XLIKE_GC_BACKGROUND; 886 mask |= XLIKE_GC_BACKGROUND;
882 } 887 }
883 888
884 /* This special case comes from a request to draw text with a face which has 889 /* This special case comes from a request to draw text with a face which has
885 the dim property. We'll use a stippled foreground GC. */ 890 the dim property. We'll use a stippled foreground GC. */
886 if (EQ (bg_pmap, Qdim)) 891 if (EQ (bg_pixmap, Qdim))
887 { 892 {
888 assert (DEVICE_XLIKE_GRAY_PIXMAP (d) != XLIKE_NONE); 893 assert (DEVICE_XLIKE_GRAY_PIXMAP (d) != XLIKE_NONE);
889 894
890 XLIKE_SET_GC_FILL (gcv, XLIKE_FILL_STIPPLED); 895 XLIKE_SET_GC_FILL (gcv, XLIKE_FILL_STIPPLED);
891 gcv.stipple = DEVICE_XLIKE_GRAY_PIXMAP (d); 896 gcv.stipple = DEVICE_XLIKE_GRAY_PIXMAP (d);
892 mask |= (XLIKE_GC_FILL | XLIKE_GC_STIPPLE); 897 mask |= (XLIKE_GC_FILL | XLIKE_GC_STIPPLE);
893 } 898 }
894 else if (IMAGE_INSTANCEP (bg_pmap) 899 else if (IMAGE_INSTANCEP (bg_pixmap)
895 && IMAGE_INSTANCE_PIXMAP_TYPE_P (XIMAGE_INSTANCE (bg_pmap))) 900 && IMAGE_INSTANCE_PIXMAP_TYPE_P (XIMAGE_INSTANCE (bg_pixmap)))
896 { 901 {
897 if (XIMAGE_INSTANCE_PIXMAP_DEPTH (bg_pmap) == 0) 902 if (XIMAGE_INSTANCE_PIXMAP_DEPTH (bg_pixmap) == 0)
898 { 903 {
899 XLIKE_SET_GC_FILL (gcv, XLIKE_FILL_OPAQUE_STIPPLED); 904 XLIKE_SET_GC_FILL (gcv, XLIKE_FILL_OPAQUE_STIPPLED);
900 gcv.stipple = XIMAGE_INSTANCE_XLIKE_PIXMAP (bg_pmap); 905 gcv.stipple = XIMAGE_INSTANCE_XLIKE_PIXMAP (bg_pixmap);
901 mask |= (XLIKE_GC_STIPPLE | XLIKE_GC_FILL); 906 mask |= (XLIKE_GC_STIPPLE | XLIKE_GC_FILL);
902 } 907 }
903 else 908 else
904 { 909 {
905 XLIKE_SET_GC_FILL (gcv, XLIKE_FILL_TILED); 910 XLIKE_SET_GC_FILL (gcv, XLIKE_FILL_TILED);
906 gcv.tile = XIMAGE_INSTANCE_XLIKE_PIXMAP (bg_pmap); 911 gcv.tile = XIMAGE_INSTANCE_XLIKE_PIXMAP (bg_pixmap);
907 mask |= (XLIKE_GC_TILE | XLIKE_GC_FILL); 912 mask |= (XLIKE_GC_TILE | XLIKE_GC_FILL);
913 }
914 if (EQ (bg_placement, Qabsolute))
915 {
916 #ifdef THIS_IS_GTK
917 /* #### WARNING: this does not currently work. -- dvl
918 gcv.ts_x_origin = - FRAME_GTK_X (f);
919 gcv.ts_y_origin = - FRAME_GTK_Y (f);
920 mask |= (XLIKE_GC_TS_X_ORIGIN | XLIKE_GC_TS_Y_ORIGIN);
921 */
922 #else
923 gcv.ts_x_origin = - FRAME_X_X (f);
924 gcv.ts_y_origin = - FRAME_X_Y (f);
925 mask |= (XLIKE_GC_TS_X_ORIGIN | XLIKE_GC_TS_Y_ORIGIN);
926 #endif
908 } 927 }
909 } 928 }
910 929
911 if (!NILP (lwidth)) 930 if (!NILP (lwidth))
912 { 931 {
1076 if ((cursor && focus && NILP (bar_cursor_value) 1095 if ((cursor && focus && NILP (bar_cursor_value)
1077 && !NILP (w->text_cursor_visible_p)) || NILP (bg_pmap)) 1096 && !NILP (w->text_cursor_visible_p)) || NILP (bg_pmap))
1078 bgc = 0; 1097 bgc = 0;
1079 else 1098 else
1080 bgc = XLIKE_get_gc (f, Qnil, cachel->foreground, cachel->background, 1099 bgc = XLIKE_get_gc (f, Qnil, cachel->foreground, cachel->background,
1081 bg_pmap, Qnil); 1100 bg_pmap, cachel->background_placement, Qnil);
1082 1101
1083 if (bgc) 1102 if (bgc)
1084 { 1103 {
1085 XLIKE_FILL_RECTANGLE (dpy, x_win, bgc, clip_start, 1104 XLIKE_FILL_RECTANGLE (dpy, x_win, bgc, clip_start,
1086 ypos, clip_end - clip_start, 1105 ypos, clip_end - clip_start,
1157 #ifdef USE_XFT 1176 #ifdef USE_XFT
1158 fg = XFT_FROB_LISP_COLOR (cursor_cachel->foreground, 0); 1177 fg = XFT_FROB_LISP_COLOR (cursor_cachel->foreground, 0);
1159 bg = XFT_FROB_LISP_COLOR (cursor_cachel->background, 0); 1178 bg = XFT_FROB_LISP_COLOR (cursor_cachel->background, 0);
1160 #endif 1179 #endif
1161 gc = XLIKE_get_gc (f, font, cursor_cachel->foreground, 1180 gc = XLIKE_get_gc (f, font, cursor_cachel->foreground,
1162 cursor_cachel->background, Qnil, Qnil); 1181 cursor_cachel->background, Qnil, Qnil, Qnil);
1163 } 1182 }
1164 else if (cachel->dim) 1183 else if (cachel->dim)
1165 { 1184 {
1166 /* Ensure the gray bitmap exists */ 1185 /* Ensure the gray bitmap exists */
1167 if (DEVICE_XLIKE_GRAY_PIXMAP (d) == XLIKE_NONE) 1186 if (DEVICE_XLIKE_GRAY_PIXMAP (d) == XLIKE_NONE)
1179 #ifdef USE_XFT 1198 #ifdef USE_XFT
1180 fg = XFT_FROB_LISP_COLOR (cachel->foreground, 1); 1199 fg = XFT_FROB_LISP_COLOR (cachel->foreground, 1);
1181 bg = XFT_FROB_LISP_COLOR (cachel->background, 0); 1200 bg = XFT_FROB_LISP_COLOR (cachel->background, 0);
1182 #endif 1201 #endif
1183 gc = XLIKE_get_gc (f, font, cachel->foreground, cachel->background, 1202 gc = XLIKE_get_gc (f, font, cachel->foreground, cachel->background,
1184 Qdim, Qnil); 1203 Qdim, Qnil, Qnil);
1185 } 1204 }
1186 else 1205 else
1187 { 1206 {
1188 #ifdef USE_XFT 1207 #ifdef USE_XFT
1189 fg = XFT_FROB_LISP_COLOR (cachel->foreground, 0); 1208 fg = XFT_FROB_LISP_COLOR (cachel->foreground, 0);
1190 bg = XFT_FROB_LISP_COLOR (cachel->background, 0); 1209 bg = XFT_FROB_LISP_COLOR (cachel->background, 0);
1191 #endif 1210 #endif
1192 gc = XLIKE_get_gc (f, font, cachel->foreground, cachel->background, 1211 gc = XLIKE_get_gc (f, font, cachel->foreground, cachel->background,
1193 Qnil, Qnil); 1212 Qnil, Qnil, Qnil);
1194 } 1213 }
1195 #ifdef USE_XFT 1214 #ifdef USE_XFT
1196 { 1215 {
1197 XftFont *rf = FONT_INSTANCE_X_XFTFONT (fi); 1216 XftFont *rf = FONT_INSTANCE_X_XFTFONT (fi);
1198 1217
1462 #endif /* USE_XFT */ 1481 #endif /* USE_XFT */
1463 { 1482 {
1464 XLIKE_RECTANGLE clip_box; 1483 XLIKE_RECTANGLE clip_box;
1465 XLIKE_GC cgc; 1484 XLIKE_GC cgc;
1466 cgc = XLIKE_get_gc (f, font, cursor_cachel->foreground, 1485 cgc = XLIKE_get_gc (f, font, cursor_cachel->foreground,
1467 cursor_cachel->background, Qnil, Qnil); 1486 cursor_cachel->background, Qnil, Qnil, Qnil);
1468 1487
1469 clip_box.x = 0; 1488 clip_box.x = 0;
1470 clip_box.y = 0; 1489 clip_box.y = 0;
1471 clip_box.width = cursor_width; 1490 clip_box.width = cursor_width;
1472 clip_box.height = height; 1491 clip_box.height = height;
1533 int bogusly_obtained_ascent_value = 1552 int bogusly_obtained_ascent_value =
1534 XFONT_INSTANCE (FACE_CACHEL_FONT (cachel, runs[0].charset))->ascent; 1553 XFONT_INSTANCE (FACE_CACHEL_FONT (cachel, runs[0].charset))->ascent;
1535 1554
1536 if (!NILP (bar_cursor_value)) 1555 if (!NILP (bar_cursor_value))
1537 { 1556 {
1538 gc = XLIKE_get_gc (f, Qnil, cursor_cachel->background, Qnil, Qnil, 1557 gc = XLIKE_get_gc (f, Qnil, cursor_cachel->background, Qnil,
1558 Qnil, Qnil,
1539 make_int (bar_width)); 1559 make_int (bar_width));
1540 } 1560 }
1541 else 1561 else
1542 { 1562 {
1543 gc = XLIKE_get_gc (f, Qnil, cursor_cachel->background, 1563 gc = XLIKE_get_gc (f, Qnil, cursor_cachel->background,
1544 Qnil, Qnil, Qnil); 1564 Qnil, Qnil, Qnil, Qnil);
1545 } 1565 }
1546 1566
1547 tmp_y = dl->ypos - bogusly_obtained_ascent_value; 1567 tmp_y = dl->ypos - bogusly_obtained_ascent_value;
1548 tmp_height = cursor_height; 1568 tmp_height = cursor_height;
1549 if (tmp_y + tmp_height > (int) (ypos + height)) 1569 if (tmp_y + tmp_height > (int) (ypos + height))
1727 struct face_cachel *cursor_cachel = 1747 struct face_cachel *cursor_cachel =
1728 WINDOW_FACE_CACHEL (w, 1748 WINDOW_FACE_CACHEL (w,
1729 get_builtin_face_cache_index 1749 get_builtin_face_cache_index
1730 (w, Vtext_cursor_face)); 1750 (w, Vtext_cursor_face));
1731 1751
1732 gc = XLIKE_get_gc (f, Qnil, cursor_cachel->background, Qnil, Qnil, Qnil); 1752 gc = XLIKE_get_gc (f, Qnil, cursor_cachel->background, Qnil, Qnil, Qnil,
1753 Qnil);
1733 1754
1734 if (cursor_width > db->xpos + dga->width - cursor_start) 1755 if (cursor_width > db->xpos + dga->width - cursor_start)
1735 cursor_width = db->xpos + dga->width - cursor_start; 1756 cursor_width = db->xpos + dga->width - cursor_start;
1736 1757
1737 if (focus) 1758 if (focus)
1872 || !IMAGE_INSTANCE_PIXMAP_TYPE_P (XIMAGE_INSTANCE (bg_pmap))) 1893 || !IMAGE_INSTANCE_PIXMAP_TYPE_P (XIMAGE_INSTANCE (bg_pmap)))
1873 bg_pmap = Qnil; 1894 bg_pmap = Qnil;
1874 1895
1875 if (NILP (bg_pmap)) 1896 if (NILP (bg_pmap))
1876 gc = XLIKE_get_gc (f, Qnil, WINDOW_FACE_CACHEL_BACKGROUND (w, rb->findex), 1897 gc = XLIKE_get_gc (f, Qnil, WINDOW_FACE_CACHEL_BACKGROUND (w, rb->findex),
1877 Qnil, Qnil, Qnil); 1898 Qnil, Qnil, Qnil, Qnil);
1878 else 1899 else
1879 gc = XLIKE_get_gc (f, Qnil, WINDOW_FACE_CACHEL_FOREGROUND (w, rb->findex), 1900 gc = XLIKE_get_gc (f, Qnil, WINDOW_FACE_CACHEL_FOREGROUND (w, rb->findex),
1880 WINDOW_FACE_CACHEL_BACKGROUND (w, rb->findex), bg_pmap, 1901 WINDOW_FACE_CACHEL_BACKGROUND (w, rb->findex),
1902 bg_pmap,
1903 WINDOW_FACE_CACHEL_BACKGROUND_PLACEMENT (w, rb->findex),
1881 Qnil); 1904 Qnil);
1882 1905
1883 XLIKE_FILL_RECTANGLE (dpy, x_win, gc, x, y, width, height); 1906 XLIKE_FILL_RECTANGLE (dpy, x_win, gc, x, y, width, height);
1884 1907
1885 /* If this rune is marked as having the cursor, then it is actually 1908 /* If this rune is marked as having the cursor, then it is actually
1896 1919
1897 fi = XFONT_INSTANCE (FACE_CACHEL_FONT 1920 fi = XFONT_INSTANCE (FACE_CACHEL_FONT
1898 (WINDOW_FACE_CACHEL (w, rb->findex), 1921 (WINDOW_FACE_CACHEL (w, rb->findex),
1899 Vcharset_ascii)); 1922 Vcharset_ascii));
1900 1923
1901 gc = XLIKE_get_gc (f, Qnil, cursor_cachel->background, Qnil, Qnil, Qnil); 1924 gc = XLIKE_get_gc (f, Qnil, cursor_cachel->background, Qnil,
1925 Qnil, Qnil, Qnil);
1902 1926
1903 cursor_y = dl->ypos - fi->ascent; 1927 cursor_y = dl->ypos - fi->ascent;
1904 cursor_height = fi->height; 1928 cursor_height = fi->height;
1905 if (cursor_y + cursor_height > y + height) 1929 if (cursor_y + cursor_height > y + height)
1906 cursor_height = y + height - cursor_y; 1930 cursor_height = y + height - cursor_y;
1915 else 1939 else
1916 { 1940 {
1917 int bar_width = EQ (bar_cursor_value, Qt) ? 1 : 2; 1941 int bar_width = EQ (bar_cursor_value, Qt) ? 1 : 2;
1918 1942
1919 gc = XLIKE_get_gc (f, Qnil, cursor_cachel->background, 1943 gc = XLIKE_get_gc (f, Qnil, cursor_cachel->background,
1920 Qnil, Qnil, make_int (bar_width)); 1944 Qnil, Qnil, Qnil,
1945 make_int (bar_width));
1921 XLIKE_DRAW_LINE (dpy, x_win, gc, cursor_start + bar_width - 1, 1946 XLIKE_DRAW_LINE (dpy, x_win, gc, cursor_start + bar_width - 1,
1922 cursor_y, cursor_start + bar_width - 1, 1947 cursor_y, cursor_start + bar_width - 1,
1923 cursor_y + cursor_height - 1); 1948 cursor_y + cursor_height - 1);
1924 } 1949 }
1925 } 1950 }
1960 /* First clear the area not covered by the line. */ 1985 /* First clear the area not covered by the line. */
1961 if (height - rb->object.hline.thickness > 0) 1986 if (height - rb->object.hline.thickness > 0)
1962 { 1987 {
1963 gc = XLIKE_get_gc (f, Qnil, 1988 gc = XLIKE_get_gc (f, Qnil,
1964 WINDOW_FACE_CACHEL_FOREGROUND (w, rb->findex), 1989 WINDOW_FACE_CACHEL_FOREGROUND (w, rb->findex),
1965 Qnil, Qnil, Qnil); 1990 Qnil, Qnil, Qnil, Qnil);
1966 1991
1967 if (ypos2 - ypos1 > 0) 1992 if (ypos2 - ypos1 > 0)
1968 XLIKE_FILL_RECTANGLE (dpy, x_win, gc, x, ypos1, width, ypos2 - ypos1); 1993 XLIKE_FILL_RECTANGLE (dpy, x_win, gc, x, ypos1, width, ypos2 - ypos1);
1969 if (ypos4 - ypos3 > 0) 1994 if (ypos4 - ypos3 > 0)
1970 XLIKE_FILL_RECTANGLE (dpy, x_win, gc, x, ypos1, width, ypos2 - ypos1); 1995 XLIKE_FILL_RECTANGLE (dpy, x_win, gc, x, ypos1, width, ypos2 - ypos1);
1977 FRAME_GTK_TEXT_WIDGET (f), "hline", x, x + width, ypos2); 2002 FRAME_GTK_TEXT_WIDGET (f), "hline", x, x + width, ypos2);
1978 } 2003 }
1979 #else /* THIS_IS_X */ 2004 #else /* THIS_IS_X */
1980 /* Now draw the line. */ 2005 /* Now draw the line. */
1981 gc = XLIKE_get_gc (f, Qnil, WINDOW_FACE_CACHEL_BACKGROUND (w, rb->findex), 2006 gc = XLIKE_get_gc (f, Qnil, WINDOW_FACE_CACHEL_BACKGROUND (w, rb->findex),
1982 Qnil, Qnil, Qnil); 2007 Qnil, Qnil, Qnil, Qnil);
1983 2008
1984 if (ypos2 < ypos1) 2009 if (ypos2 < ypos1)
1985 ypos2 = ypos1; 2010 ypos2 = ypos1;
1986 if (ypos3 > ypos4) 2011 if (ypos3 > ypos4)
1987 ypos3 = ypos4; 2012 ypos3 = ypos4;
1998 given face. 2023 given face.
1999 ****************************************************************************/ 2024 ****************************************************************************/
2000 static void 2025 static void
2001 XLIKE_clear_region (Lisp_Object UNUSED (locale), struct device* d, 2026 XLIKE_clear_region (Lisp_Object UNUSED (locale), struct device* d,
2002 struct frame* f, face_index UNUSED (findex), int x, int y, 2027 struct frame* f, face_index UNUSED (findex), int x, int y,
2003 int width, int height, Lisp_Object fcolor, 2028 int width, int height,
2004 Lisp_Object bcolor, Lisp_Object background_pixmap) 2029 Lisp_Object fcolor, Lisp_Object bcolor,
2030 Lisp_Object background_pixmap,
2031 Lisp_Object background_placement)
2005 { 2032 {
2006 XLIKE_DISPLAY dpy = GET_XLIKE_DISPLAY (d); 2033 XLIKE_DISPLAY dpy = GET_XLIKE_DISPLAY (d);
2007 XLIKE_WINDOW x_win = GET_XLIKE_WINDOW (f); 2034 XLIKE_WINDOW x_win = GET_XLIKE_WINDOW (f);
2008 XLIKE_GC gc = NULL; 2035 XLIKE_GC gc = NULL;
2009 2036
2010 if (!UNBOUNDP (background_pixmap)) 2037 if (!UNBOUNDP (background_pixmap))
2011 { 2038 {
2012 gc = XLIKE_get_gc (f, Qnil, fcolor, bcolor, background_pixmap, Qnil); 2039 gc = XLIKE_get_gc (f, Qnil, fcolor, bcolor,
2040 background_pixmap, background_placement, Qnil);
2013 } 2041 }
2014 2042
2015 if (gc) 2043 if (gc)
2016 XLIKE_FILL_RECTANGLE (dpy, x_win, gc, x, y, width, height); 2044 XLIKE_FILL_RECTANGLE (dpy, x_win, gc, x, y, width, height);
2017 else 2045 else
2053 redisplay_clear_region (window, findex, x, y, width, height); 2081 redisplay_clear_region (window, findex, x, y, width, height);
2054 2082
2055 if (NILP (w->text_cursor_visible_p)) 2083 if (NILP (w->text_cursor_visible_p))
2056 return; 2084 return;
2057 2085
2058 gc = XLIKE_get_gc (f, Qnil, cursor_cachel->background, Qnil, Qnil, Qnil); 2086 gc = XLIKE_get_gc (f, Qnil, cursor_cachel->background, Qnil,
2087 Qnil, Qnil, Qnil);
2059 2088
2060 default_face_font_info (window, &defascent, 0, 0, &defheight, 0); 2089 default_face_font_info (window, &defascent, 0, 0, &defheight, 0);
2061 2090
2062 /* make sure the cursor is entirely contained between y and y+height */ 2091 /* make sure the cursor is entirely contained between y and y+height */
2063 cursor_height = min (defheight, height); 2092 cursor_height = min (defheight, height);
2077 } 2106 }
2078 else 2107 else
2079 { 2108 {
2080 int bar_width = EQ (bar_cursor_value, Qt) ? 1 : 2; 2109 int bar_width = EQ (bar_cursor_value, Qt) ? 1 : 2;
2081 2110
2082 gc = XLIKE_get_gc (f, Qnil, cursor_cachel->background, Qnil, Qnil, 2111 gc = XLIKE_get_gc (f, Qnil, cursor_cachel->background, Qnil,
2112 Qnil, Qnil,
2083 make_int (bar_width)); 2113 make_int (bar_width));
2084 XLIKE_DRAW_LINE (dpy, x_win, gc, x + bar_width - 1, cursor_y, 2114 XLIKE_DRAW_LINE (dpy, x_win, gc, x + bar_width - 1, cursor_y,
2085 x + bar_width - 1, cursor_y + cursor_height - 1); 2115 x + bar_width - 1, cursor_y + cursor_height - 1);
2086 } 2116 }
2087 } 2117 }