comparison src/xterm.c @ 83541:694bbb62a75d

Merged from emacs@sv.gnu.org Patches applied: * emacs@sv.gnu.org/emacs--devo--0--patch-371 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-372 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-373 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-374 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-375 Merge from gnus--rel--5.10 * emacs@sv.gnu.org/emacs--devo--0--patch-376 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-377 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-378 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-379 Merge from erc--emacs--21 * emacs@sv.gnu.org/emacs--devo--0--patch-380 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-381 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-382 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-383 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-384 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-385 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-386 Update from erc--emacs--22 * emacs@sv.gnu.org/emacs--devo--0--patch-387 Fix ERC bug introduced in last patch * emacs@sv.gnu.org/emacs--devo--0--patch-388 Update from erc--emacs--22 * emacs@sv.gnu.org/emacs--devo--0--patch-389 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-390 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-391 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-392 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-393 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-394 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-395 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-396 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-397 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-398 Merge from gnus--rel--5.10 * emacs@sv.gnu.org/emacs--devo--0--patch-399 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-400 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-401 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-402 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-403 Rcirc update from Ryan Yeske * emacs@sv.gnu.org/emacs--devo--0--patch-404 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-405 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-406 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-407 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-408 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-409 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-410 Merge from gnus--rel--5.10 * emacs@sv.gnu.org/emacs--devo--0--patch-411 Miscellaneous tq-related fixes. * emacs@sv.gnu.org/emacs--devo--0--patch-412 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-121 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-122 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-123 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-124 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-125 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-126 Merge from emacs--devo--0 * emacs@sv.gnu.org/gnus--rel--5.10--patch-127 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-581
author Karoly Lorentey <lorentey@elte.hu>
date Sat, 14 Oct 2006 16:56:21 +0000
parents 0014f454c421 759e19ea81e5
children 2d56e13fd23d
comparison
equal deleted inserted replaced
83540:0c89a85addc3 83541:694bbb62a75d
178 static Lisp_Object last_window; 178 static Lisp_Object last_window;
179 179
180 /* Non-zero means make use of UNDERLINE_POSITION font properties. */ 180 /* Non-zero means make use of UNDERLINE_POSITION font properties. */
181 181
182 int x_use_underline_position_properties; 182 int x_use_underline_position_properties;
183
184 /* Non-zero means to draw the underline at the same place as the descent line. */
185
186 int x_underline_at_descent_line;
183 187
184 /* This is a chain of structures for all the X displays currently in 188 /* This is a chain of structures for all the X displays currently in
185 use. */ 189 use. */
186 190
187 struct x_display_info *x_display_list; 191 struct x_display_info *x_display_list;
2599 else if (!s->background_filled_p) 2603 else if (!s->background_filled_p)
2600 { 2604 {
2601 int background_width = s->background_width; 2605 int background_width = s->background_width;
2602 int x = s->x, left_x = window_box_left_offset (s->w, TEXT_AREA); 2606 int x = s->x, left_x = window_box_left_offset (s->w, TEXT_AREA);
2603 2607
2604 if (x < left_x) 2608 /* Don't draw into left margin, fringe or scrollbar area
2609 except for header line and mode line. */
2610 if (x < left_x && !s->row->mode_line_p)
2605 { 2611 {
2606 background_width -= left_x - x; 2612 background_width -= left_x - x;
2607 x = left_x; 2613 x = left_x;
2608 } 2614 }
2609 if (background_width > 0) 2615 if (background_width > 0)
2693 2699
2694 /* Get the underline thickness. Default is 1 pixel. */ 2700 /* Get the underline thickness. Default is 1 pixel. */
2695 if (!XGetFontProperty (s->font, XA_UNDERLINE_THICKNESS, &h)) 2701 if (!XGetFontProperty (s->font, XA_UNDERLINE_THICKNESS, &h))
2696 h = 1; 2702 h = 1;
2697 2703
2698 /* Get the underline position. This is the recommended 2704 if (x_underline_at_descent_line)
2699 vertical offset in pixels from the baseline to the top of
2700 the underline. This is a signed value according to the
2701 specs, and its default is
2702
2703 ROUND ((maximum descent) / 2), with
2704 ROUND(x) = floor (x + 0.5) */
2705
2706 if (x_use_underline_position_properties
2707 && XGetFontProperty (s->font, XA_UNDERLINE_POSITION, &tem))
2708 y = s->ybase + (long) tem;
2709 else if (s->face->font)
2710 y = s->ybase + (s->face->font->max_bounds.descent + 1) / 2;
2711 else
2712 y = s->y + s->height - h; 2705 y = s->y + s->height - h;
2706 else
2707 {
2708 /* Get the underline position. This is the recommended
2709 vertical offset in pixels from the baseline to the top of
2710 the underline. This is a signed value according to the
2711 specs, and its default is
2712
2713 ROUND ((maximum descent) / 2), with
2714 ROUND(x) = floor (x + 0.5) */
2715
2716 if (x_use_underline_position_properties
2717 && XGetFontProperty (s->font, XA_UNDERLINE_POSITION, &tem))
2718 y = s->ybase + (long) tem;
2719 else if (s->face->font)
2720 y = s->ybase + (s->face->font->max_bounds.descent + 1) / 2;
2721 }
2713 2722
2714 if (s->face->underline_defaulted_p) 2723 if (s->face->underline_defaulted_p)
2715 XFillRectangle (s->display, s->window, s->gc, 2724 XFillRectangle (s->display, s->window, s->gc,
2716 s->x, y, s->width, h); 2725 s->x, y, s->background_width, h);
2717 else 2726 else
2718 { 2727 {
2719 XGCValues xgcv; 2728 XGCValues xgcv;
2720 XGetGCValues (s->display, s->gc, GCForeground, &xgcv); 2729 XGetGCValues (s->display, s->gc, GCForeground, &xgcv);
2721 XSetForeground (s->display, s->gc, s->face->underline_color); 2730 XSetForeground (s->display, s->gc, s->face->underline_color);
2722 XFillRectangle (s->display, s->window, s->gc, 2731 XFillRectangle (s->display, s->window, s->gc,
2723 s->x, y, s->width, h); 2732 s->x, y, s->background_width, h);
2724 XSetForeground (s->display, s->gc, xgcv.foreground); 2733 XSetForeground (s->display, s->gc, xgcv.foreground);
2725 } 2734 }
2726 } 2735 }
2727 2736
2728 /* Draw overline. */ 2737 /* Draw overline. */
2730 { 2739 {
2731 unsigned long dy = 0, h = 1; 2740 unsigned long dy = 0, h = 1;
2732 2741
2733 if (s->face->overline_color_defaulted_p) 2742 if (s->face->overline_color_defaulted_p)
2734 XFillRectangle (s->display, s->window, s->gc, s->x, s->y + dy, 2743 XFillRectangle (s->display, s->window, s->gc, s->x, s->y + dy,
2735 s->width, h); 2744 s->background_width, h);
2736 else 2745 else
2737 { 2746 {
2738 XGCValues xgcv; 2747 XGCValues xgcv;
2739 XGetGCValues (s->display, s->gc, GCForeground, &xgcv); 2748 XGetGCValues (s->display, s->gc, GCForeground, &xgcv);
2740 XSetForeground (s->display, s->gc, s->face->overline_color); 2749 XSetForeground (s->display, s->gc, s->face->overline_color);
2741 XFillRectangle (s->display, s->window, s->gc, s->x, s->y + dy, 2750 XFillRectangle (s->display, s->window, s->gc, s->x, s->y + dy,
2742 s->width, h); 2751 s->background_width, h);
2743 XSetForeground (s->display, s->gc, xgcv.foreground); 2752 XSetForeground (s->display, s->gc, xgcv.foreground);
2744 } 2753 }
2745 } 2754 }
2746 2755
2747 /* Draw strike-through. */ 2756 /* Draw strike-through. */
10094 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); 10103 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
10095 int i; 10104 int i;
10096 10105
10097 for (i = 0; i < dpyinfo->n_fonts; i++) 10106 for (i = 0; i < dpyinfo->n_fonts; i++)
10098 if (dpyinfo->font_table[i].name 10107 if (dpyinfo->font_table[i].name
10099 && (!strcmp (dpyinfo->font_table[i].name, fontname) 10108 && (!strcasecmp (dpyinfo->font_table[i].name, fontname)
10100 || !strcmp (dpyinfo->font_table[i].full_name, fontname))) 10109 || !strcasecmp (dpyinfo->font_table[i].full_name, fontname)))
10101 return (dpyinfo->font_table + i); 10110 return (dpyinfo->font_table + i);
10102 return NULL; 10111 return NULL;
10103 } 10112 }
10104 10113
10105 10114
10642 dpyinfo->Xatom_Scrollbar = XInternAtom (dpyinfo->display, "SCROLLBAR", 10651 dpyinfo->Xatom_Scrollbar = XInternAtom (dpyinfo->display, "SCROLLBAR",
10643 False); 10652 False);
10644 10653
10645 dpyinfo->cut_buffers_initialized = 0; 10654 dpyinfo->cut_buffers_initialized = 0;
10646 10655
10656 dpyinfo->x_dnd_atoms_size = 8;
10657 dpyinfo->x_dnd_atoms_length = 0;
10658 dpyinfo->x_dnd_atoms = xmalloc (sizeof (*dpyinfo->x_dnd_atoms)
10659 * dpyinfo->x_dnd_atoms_size);
10660
10647 connection = ConnectionNumber (dpyinfo->display); 10661 connection = ConnectionNumber (dpyinfo->display);
10648 dpyinfo->connection = connection; 10662 dpyinfo->connection = connection;
10649 10663
10650 { 10664 {
10651 char null_bits[1]; 10665 char null_bits[1];
11102 nil means ignore them. If you encounter fonts with bogus 11116 nil means ignore them. If you encounter fonts with bogus
11103 UNDERLINE_POSITION font properties, for example 7x13 on XFree prior 11117 UNDERLINE_POSITION font properties, for example 7x13 on XFree prior
11104 to 4.1, set this to nil. */); 11118 to 4.1, set this to nil. */);
11105 x_use_underline_position_properties = 1; 11119 x_use_underline_position_properties = 1;
11106 11120
11121 DEFVAR_BOOL ("x-underline-at-descent-line",
11122 &x_underline_at_descent_line,
11123 doc: /* *Non-nil means to draw the underline at the same place as the descent line.
11124 nil means to draw the underline according to the value of the variable
11125 `x-use-underline-position-properties', which is usually at the baseline
11126 level. The default value is nil. */);
11127 x_underline_at_descent_line = 0;
11128
11107 DEFVAR_BOOL ("x-mouse-click-focus-ignore-position", 11129 DEFVAR_BOOL ("x-mouse-click-focus-ignore-position",
11108 &x_mouse_click_focus_ignore_position, 11130 &x_mouse_click_focus_ignore_position,
11109 doc: /* Non-nil means that a mouse click to focus a frame does not move point. 11131 doc: /* Non-nil means that a mouse click to focus a frame does not move point.
11110 This variable is only used when the window manager requires that you 11132 This variable is only used when the window manager requires that you
11111 click on a frame to select it (give it focus). In that case, a value 11133 click on a frame to select it (give it focus). In that case, a value