Mercurial > emacs
comparison src/xterm.c @ 90596:6823a91487f2
Merge from emacs--devo--0
Patches applied:
* emacs--devo--0 (patch 399-413)
- Update from CVS
- Rcirc update from Ryan Yeske
- Merge from gnus--rel--5.10
- Miscellaneous tq-related fixes.
* gnus--rel--5.10 (patch 126-127)
- Merge from emacs--devo--0
- Update from CVS
Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-105
author | Miles Bader <miles@gnu.org> |
---|---|
date | Mon, 28 Aug 2006 04:33:45 +0000 |
parents | 7f3f771c85fa 759e19ea81e5 |
children | a1a25ac6c88a |
comparison
equal
deleted
inserted
replaced
90595:fd59c4164a14 | 90596:6823a91487f2 |
---|---|
184 static Lisp_Object last_window; | 184 static Lisp_Object last_window; |
185 | 185 |
186 /* Non-zero means make use of UNDERLINE_POSITION font properties. */ | 186 /* Non-zero means make use of UNDERLINE_POSITION font properties. */ |
187 | 187 |
188 int x_use_underline_position_properties; | 188 int x_use_underline_position_properties; |
189 | |
190 /* Non-zero means to draw the underline at the same place as the descent line. */ | |
191 | |
192 int x_underline_at_descent_line; | |
189 | 193 |
190 /* This is a chain of structures for all the X displays currently in | 194 /* This is a chain of structures for all the X displays currently in |
191 use. */ | 195 use. */ |
192 | 196 |
193 struct x_display_info *x_display_list; | 197 struct x_display_info *x_display_list; |
2740 else if (!s->background_filled_p) | 2744 else if (!s->background_filled_p) |
2741 { | 2745 { |
2742 int background_width = s->background_width; | 2746 int background_width = s->background_width; |
2743 int x = s->x, left_x = window_box_left_offset (s->w, TEXT_AREA); | 2747 int x = s->x, left_x = window_box_left_offset (s->w, TEXT_AREA); |
2744 | 2748 |
2745 if (x < left_x) | 2749 /* Don't draw into left margin, fringe or scrollbar area |
2750 except for header line and mode line. */ | |
2751 if (x < left_x && !s->row->mode_line_p) | |
2746 { | 2752 { |
2747 background_width -= left_x - x; | 2753 background_width -= left_x - x; |
2748 x = left_x; | 2754 x = left_x; |
2749 } | 2755 } |
2750 if (background_width > 0) | 2756 if (background_width > 0) |
2856 else | 2862 else |
2857 #endif /* USE_FONT_BACKEND */ | 2863 #endif /* USE_FONT_BACKEND */ |
2858 if (!XGetFontProperty (s->font, XA_UNDERLINE_THICKNESS, &h)) | 2864 if (!XGetFontProperty (s->font, XA_UNDERLINE_THICKNESS, &h)) |
2859 h = 1; | 2865 h = 1; |
2860 | 2866 |
2861 /* Get the underline position. This is the recommended | |
2862 vertical offset in pixels from the baseline to the top of | |
2863 the underline. This is a signed value according to the | |
2864 specs, and its default is | |
2865 | |
2866 ROUND ((maximum descent) / 2), with | |
2867 ROUND(x) = floor (x + 0.5) */ | |
2868 | |
2869 #ifdef USE_FONT_BACKEND | 2867 #ifdef USE_FONT_BACKEND |
2870 if (enable_font_backend) | 2868 if (enable_font_backend) |
2871 { | 2869 { |
2872 if (s->face->font) | 2870 if (s->face->font) |
2873 /* In the future, we must use information of font. */ | 2871 /* In the future, we must use information of font. */ |
2875 else | 2873 else |
2876 y = s->y + s->height - h; | 2874 y = s->y + s->height - h; |
2877 } | 2875 } |
2878 else | 2876 else |
2879 #endif | 2877 #endif |
2880 if (x_use_underline_position_properties | 2878 if (x_underline_at_descent_line) |
2881 && XGetFontProperty (s->font, XA_UNDERLINE_POSITION, &tem)) | |
2882 y = s->ybase + (long) tem; | |
2883 else if (s->face->font) | |
2884 y = s->ybase + (s->face->font->max_bounds.descent + 1) / 2; | |
2885 else | |
2886 y = s->y + s->height - h; | 2879 y = s->y + s->height - h; |
2880 else | |
2881 { | |
2882 /* Get the underline position. This is the recommended | |
2883 vertical offset in pixels from the baseline to the top of | |
2884 the underline. This is a signed value according to the | |
2885 specs, and its default is | |
2886 | |
2887 ROUND ((maximum descent) / 2), with | |
2888 ROUND(x) = floor (x + 0.5) */ | |
2889 | |
2890 if (x_use_underline_position_properties | |
2891 && XGetFontProperty (s->font, XA_UNDERLINE_POSITION, &tem)) | |
2892 y = s->ybase + (long) tem; | |
2893 else if (s->face->font) | |
2894 y = s->ybase + (s->face->font->max_bounds.descent + 1) / 2; | |
2895 } | |
2887 | 2896 |
2888 if (s->face->underline_defaulted_p) | 2897 if (s->face->underline_defaulted_p) |
2889 XFillRectangle (s->display, s->window, s->gc, | 2898 XFillRectangle (s->display, s->window, s->gc, |
2890 s->x, y, s->width, h); | 2899 s->x, y, s->background_width, h); |
2891 else | 2900 else |
2892 { | 2901 { |
2893 XGCValues xgcv; | 2902 XGCValues xgcv; |
2894 XGetGCValues (s->display, s->gc, GCForeground, &xgcv); | 2903 XGetGCValues (s->display, s->gc, GCForeground, &xgcv); |
2895 XSetForeground (s->display, s->gc, s->face->underline_color); | 2904 XSetForeground (s->display, s->gc, s->face->underline_color); |
2896 XFillRectangle (s->display, s->window, s->gc, | 2905 XFillRectangle (s->display, s->window, s->gc, |
2897 s->x, y, s->width, h); | 2906 s->x, y, s->background_width, h); |
2898 XSetForeground (s->display, s->gc, xgcv.foreground); | 2907 XSetForeground (s->display, s->gc, xgcv.foreground); |
2899 } | 2908 } |
2900 } | 2909 } |
2901 | 2910 |
2902 /* Draw overline. */ | 2911 /* Draw overline. */ |
2904 { | 2913 { |
2905 unsigned long dy = 0, h = 1; | 2914 unsigned long dy = 0, h = 1; |
2906 | 2915 |
2907 if (s->face->overline_color_defaulted_p) | 2916 if (s->face->overline_color_defaulted_p) |
2908 XFillRectangle (s->display, s->window, s->gc, s->x, s->y + dy, | 2917 XFillRectangle (s->display, s->window, s->gc, s->x, s->y + dy, |
2909 s->width, h); | 2918 s->background_width, h); |
2910 else | 2919 else |
2911 { | 2920 { |
2912 XGCValues xgcv; | 2921 XGCValues xgcv; |
2913 XGetGCValues (s->display, s->gc, GCForeground, &xgcv); | 2922 XGetGCValues (s->display, s->gc, GCForeground, &xgcv); |
2914 XSetForeground (s->display, s->gc, s->face->overline_color); | 2923 XSetForeground (s->display, s->gc, s->face->overline_color); |
2915 XFillRectangle (s->display, s->window, s->gc, s->x, s->y + dy, | 2924 XFillRectangle (s->display, s->window, s->gc, s->x, s->y + dy, |
2916 s->width, h); | 2925 s->background_width, h); |
2917 XSetForeground (s->display, s->gc, xgcv.foreground); | 2926 XSetForeground (s->display, s->gc, xgcv.foreground); |
2918 } | 2927 } |
2919 } | 2928 } |
2920 | 2929 |
2921 /* Draw strike-through. */ | 2930 /* Draw strike-through. */ |
11433 nil means ignore them. If you encounter fonts with bogus | 11442 nil means ignore them. If you encounter fonts with bogus |
11434 UNDERLINE_POSITION font properties, for example 7x13 on XFree prior | 11443 UNDERLINE_POSITION font properties, for example 7x13 on XFree prior |
11435 to 4.1, set this to nil. */); | 11444 to 4.1, set this to nil. */); |
11436 x_use_underline_position_properties = 1; | 11445 x_use_underline_position_properties = 1; |
11437 | 11446 |
11447 DEFVAR_BOOL ("x-underline-at-descent-line", | |
11448 &x_underline_at_descent_line, | |
11449 doc: /* *Non-nil means to draw the underline at the same place as the descent line. | |
11450 nil means to draw the underline according to the value of the variable | |
11451 `x-use-underline-position-properties', which is usually at the baseline | |
11452 level. The default value is nil. */); | |
11453 x_underline_at_descent_line = 0; | |
11454 | |
11438 DEFVAR_BOOL ("x-mouse-click-focus-ignore-position", | 11455 DEFVAR_BOOL ("x-mouse-click-focus-ignore-position", |
11439 &x_mouse_click_focus_ignore_position, | 11456 &x_mouse_click_focus_ignore_position, |
11440 doc: /* Non-nil means that a mouse click to focus a frame does not move point. | 11457 doc: /* Non-nil means that a mouse click to focus a frame does not move point. |
11441 This variable is only used when the window manager requires that you | 11458 This variable is only used when the window manager requires that you |
11442 click on a frame to select it (give it focus). In that case, a value | 11459 click on a frame to select it (give it focus). In that case, a value |