Mercurial > emacs
comparison src/xdisp.c @ 90386:2ecafc6d5db7
Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-58
Merge from emacs--devo--0
Patches applied:
* emacs--devo--0 (patch 239-258)
- Update from CVS
- (Ffield_beginning, find_field): Undo change of 2006-04-23.
- Rcirc patch from Ryan Yeske
- Merge from gnus--rel--5.10
- Clean up lisp/gnus/ChangeLog a bit
* gnus--rel--5.10 (patch 91-98)
- Merge from emacs--devo--0
- Update from CVS
author | Miles Bader <miles@gnu.org> |
---|---|
date | Tue, 02 May 2006 05:51:52 +0000 |
parents | 72dea2ff0142 91d5409c3df8 |
children | 146cd8369025 |
comparison
equal
deleted
inserted
replaced
90385:72dea2ff0142 | 90386:2ecafc6d5db7 |
---|---|
9058 | 9058 |
9059 GCPRO1 (tail); | 9059 GCPRO1 (tail); |
9060 update_menu_bar (f, 0); | 9060 update_menu_bar (f, 0); |
9061 #ifdef HAVE_WINDOW_SYSTEM | 9061 #ifdef HAVE_WINDOW_SYSTEM |
9062 update_tool_bar (f, 0); | 9062 update_tool_bar (f, 0); |
9063 #ifdef MAC_OS | |
9064 mac_update_title_bar (f, 0); | |
9065 #endif | |
9063 #endif | 9066 #endif |
9064 UNGCPRO; | 9067 UNGCPRO; |
9065 } | 9068 } |
9066 | 9069 |
9067 unbind_to (count, Qnil); | 9070 unbind_to (count, Qnil); |
9070 { | 9073 { |
9071 struct frame *sf = SELECTED_FRAME (); | 9074 struct frame *sf = SELECTED_FRAME (); |
9072 update_menu_bar (sf, 1); | 9075 update_menu_bar (sf, 1); |
9073 #ifdef HAVE_WINDOW_SYSTEM | 9076 #ifdef HAVE_WINDOW_SYSTEM |
9074 update_tool_bar (sf, 1); | 9077 update_tool_bar (sf, 1); |
9078 #ifdef MAC_OS | |
9079 mac_update_title_bar (sf, 1); | |
9080 #endif | |
9075 #endif | 9081 #endif |
9076 } | 9082 } |
9077 | 9083 |
9078 /* Motif needs this. See comment in xmenu.c. Turn it off when | 9084 /* Motif needs this. See comment in xmenu.c. Turn it off when |
9079 pending_menu_activation is not defined. */ | 9085 pending_menu_activation is not defined. */ |
9666 struct frame *f; | 9672 struct frame *f; |
9667 int *n_rows; | 9673 int *n_rows; |
9668 { | 9674 { |
9669 struct window *w = XWINDOW (f->tool_bar_window); | 9675 struct window *w = XWINDOW (f->tool_bar_window); |
9670 struct it it; | 9676 struct it it; |
9677 struct glyph_row *temp_row = w->desired_matrix->rows; | |
9671 | 9678 |
9672 /* Initialize an iterator for iteration over | 9679 /* Initialize an iterator for iteration over |
9673 F->desired_tool_bar_string in the tool-bar window of frame F. */ | 9680 F->desired_tool_bar_string in the tool-bar window of frame F. */ |
9674 init_iterator (&it, w, -1, -1, w->desired_matrix->rows, TOOL_BAR_FACE_ID); | 9681 init_iterator (&it, w, -1, -1, temp_row, TOOL_BAR_FACE_ID); |
9675 it.first_visible_x = 0; | 9682 it.first_visible_x = 0; |
9676 it.last_visible_x = FRAME_TOTAL_COLS (f) * FRAME_COLUMN_WIDTH (f); | 9683 it.last_visible_x = FRAME_TOTAL_COLS (f) * FRAME_COLUMN_WIDTH (f); |
9677 reseat_to_string (&it, NULL, f->desired_tool_bar_string, 0, 0, 0, -1); | 9684 reseat_to_string (&it, NULL, f->desired_tool_bar_string, 0, 0, 0, -1); |
9678 | 9685 |
9679 while (!ITERATOR_AT_END_P (&it)) | 9686 while (!ITERATOR_AT_END_P (&it)) |
9680 { | 9687 { |
9681 it.glyph_row = w->desired_matrix->rows; | 9688 clear_glyph_row (temp_row); |
9682 clear_glyph_row (it.glyph_row); | 9689 it.glyph_row = temp_row; |
9683 display_tool_bar_line (&it, -1); | 9690 display_tool_bar_line (&it, -1); |
9684 } | 9691 } |
9692 clear_glyph_row (temp_row); | |
9685 | 9693 |
9686 /* f->n_tool_bar_rows == 0 means "unknown"; -1 means no tool-bar. */ | 9694 /* f->n_tool_bar_rows == 0 means "unknown"; -1 means no tool-bar. */ |
9687 if (n_rows) | 9695 if (n_rows) |
9688 *n_rows = it.vpos > 0 ? it.vpos : -1; | 9696 *n_rows = it.vpos > 0 ? it.vpos : -1; |
9689 | 9697 |
9759 /* Build a string that represents the contents of the tool-bar. */ | 9767 /* Build a string that represents the contents of the tool-bar. */ |
9760 build_desired_tool_bar_string (f); | 9768 build_desired_tool_bar_string (f); |
9761 reseat_to_string (&it, NULL, f->desired_tool_bar_string, 0, 0, 0, -1); | 9769 reseat_to_string (&it, NULL, f->desired_tool_bar_string, 0, 0, 0, -1); |
9762 | 9770 |
9763 if (f->n_tool_bar_rows == 0) | 9771 if (f->n_tool_bar_rows == 0) |
9764 (void)tool_bar_lines_needed (f, &f->n_tool_bar_rows); | 9772 { |
9773 int nlines; | |
9774 | |
9775 if ((nlines = tool_bar_lines_needed (f, &f->n_tool_bar_rows), | |
9776 nlines != WINDOW_TOTAL_LINES (w))) | |
9777 { | |
9778 extern Lisp_Object Qtool_bar_lines; | |
9779 Lisp_Object frame; | |
9780 int old_height = WINDOW_TOTAL_LINES (w); | |
9781 | |
9782 XSETFRAME (frame, f); | |
9783 clear_glyph_matrix (w->desired_matrix); | |
9784 Fmodify_frame_parameters (frame, | |
9785 Fcons (Fcons (Qtool_bar_lines, | |
9786 make_number (nlines)), | |
9787 Qnil)); | |
9788 if (WINDOW_TOTAL_LINES (w) != old_height) | |
9789 { | |
9790 fonts_changed_p = 1; | |
9791 return 1; | |
9792 } | |
9793 } | |
9794 } | |
9765 | 9795 |
9766 /* Display as many lines as needed to display all tool-bar items. */ | 9796 /* Display as many lines as needed to display all tool-bar items. */ |
9767 | 9797 |
9768 if (f->n_tool_bar_rows > 0) | 9798 if (f->n_tool_bar_rows > 0) |
9769 { | 9799 { |
12955 { | 12985 { |
12956 | 12986 |
12957 /* If first window line is a continuation line, and window start | 12987 /* If first window line is a continuation line, and window start |
12958 is inside the modified region, but the first change is before | 12988 is inside the modified region, but the first change is before |
12959 current window start, we must select a new window start.*/ | 12989 current window start, we must select a new window start.*/ |
12960 if (NILP (w->start_at_line_beg)) | 12990 if (NILP (w->start_at_line_beg) |
12991 && CHARPOS (startp) > BEGV) | |
12961 { | 12992 { |
12962 /* Make sure beg_unchanged and end_unchanged are up to date. | 12993 /* Make sure beg_unchanged and end_unchanged are up to date. |
12963 Do it only if buffer has really changed. This may or may | 12994 Do it only if buffer has really changed. This may or may |
12964 not have been done by try_window_id (see which) already. */ | 12995 not have been done by try_window_id (see which) already. */ |
12965 if (MODIFF > SAVE_MODIFF | 12996 if (MODIFF > SAVE_MODIFF |
18591 { | 18622 { |
18592 /* Unibyte case. We don't have to encode, but we have to make | 18623 /* Unibyte case. We don't have to encode, but we have to make |
18593 sure to use a face suitable for unibyte. */ | 18624 sure to use a face suitable for unibyte. */ |
18594 STORE_XCHAR2B (char2b, 0, glyph->u.ch); | 18625 STORE_XCHAR2B (char2b, 0, glyph->u.ch); |
18595 } | 18626 } |
18596 else if (glyph->u.ch < 128 | 18627 else if (glyph->u.ch < 128) |
18597 && glyph->face_id < BASIC_FACE_ID_SENTINEL) | |
18598 { | 18628 { |
18599 /* Case of ASCII in a face known to fit ASCII. */ | 18629 /* Case of ASCII in a face known to fit ASCII. */ |
18600 STORE_XCHAR2B (char2b, 0, glyph->u.ch); | 18630 STORE_XCHAR2B (char2b, 0, glyph->u.ch); |
18601 } | 18631 } |
18602 else | 18632 else |
18812 face_id = glyph->face_id; | 18842 face_id = glyph->face_id; |
18813 s->face = FACE_FROM_ID (s->f, face_id); | 18843 s->face = FACE_FROM_ID (s->f, face_id); |
18814 s->font = s->face->font; | 18844 s->font = s->face->font; |
18815 s->font_info = FONT_INFO_FROM_ID (s->f, s->face->font_info_id); | 18845 s->font_info = FONT_INFO_FROM_ID (s->f, s->face->font_info_id); |
18816 s->width = glyph->pixel_width; | 18846 s->width = glyph->pixel_width; |
18847 s->nchars = 1; | |
18817 voffset = glyph->voffset; | 18848 voffset = glyph->voffset; |
18818 | 18849 |
18819 for (++glyph; | 18850 for (++glyph; |
18820 (glyph < last | 18851 (glyph < last |
18821 && glyph->type == STRETCH_GLYPH | 18852 && glyph->type == STRETCH_GLYPH |
19009 sure to use a face suitable for unibyte. */ | 19040 sure to use a face suitable for unibyte. */ |
19010 STORE_XCHAR2B (char2b, 0, c); | 19041 STORE_XCHAR2B (char2b, 0, c); |
19011 face_id = FACE_FOR_CHAR (f, face, c, -1, Qnil); | 19042 face_id = FACE_FOR_CHAR (f, face, c, -1, Qnil); |
19012 face = FACE_FROM_ID (f, face_id); | 19043 face = FACE_FROM_ID (f, face_id); |
19013 } | 19044 } |
19014 else if (c < 128 && face_id < BASIC_FACE_ID_SENTINEL) | 19045 else if (c < 128) |
19015 { | 19046 { |
19016 /* Case of ASCII in a face known to fit ASCII. */ | 19047 /* Case of ASCII in a face known to fit ASCII. */ |
19017 STORE_XCHAR2B (char2b, 0, c); | 19048 STORE_XCHAR2B (char2b, 0, c); |
19018 } | 19049 } |
19019 else if (face->font != NULL) | 19050 else if (face->font != NULL) |
19965 | 19996 |
19966 it->pixel_width = width; | 19997 it->pixel_width = width; |
19967 it->ascent = it->phys_ascent = ascent; | 19998 it->ascent = it->phys_ascent = ascent; |
19968 it->descent = it->phys_descent = height - it->ascent; | 19999 it->descent = it->phys_descent = height - it->ascent; |
19969 it->nglyphs = width > 0 && height > 0 ? 1 : 0; | 20000 it->nglyphs = width > 0 && height > 0 ? 1 : 0; |
19970 | |
19971 if (width > 0 && height > 0 && face->box != FACE_NO_BOX) | |
19972 { | |
19973 if (face->box_line_width > 0) | |
19974 { | |
19975 it->ascent += face->box_line_width; | |
19976 it->descent += face->box_line_width; | |
19977 } | |
19978 | |
19979 if (it->start_of_box_run_p) | |
19980 it->pixel_width += abs (face->box_line_width); | |
19981 if (it->end_of_box_run_p) | |
19982 it->pixel_width += abs (face->box_line_width); | |
19983 } | |
19984 | 20001 |
19985 take_vertical_position_into_account (it); | 20002 take_vertical_position_into_account (it); |
19986 } | 20003 } |
19987 | 20004 |
19988 /* Get line-height and line-spacing property at point. | 20005 /* Get line-height and line-spacing property at point. |