comparison src/window.c @ 90242:5e2d3828e89f

Revision: miles@gnu.org--gnu-2005/emacs--unicode--0--patch-91 Merge from emacs--cvs-trunk--0 Patches applied: * emacs--cvs-trunk--0 (patch 581-597) - Update from CVS - Merge from gnus--rel--5.10 * gnus--rel--5.10 (patch 133-141) - Update from CVS - Merge from emacs--cvs-trunk--0 - Update from CVS: texi/gnus.texi (RSS): Fix key description. - Update from CVS: texi/gnus.texi (Document Server Internals): Addition.
author Miles Bader <miles@gnu.org>
date Sat, 15 Oct 2005 00:26:05 +0000
parents aa89c814f853 999beda71a39
children 0ca0d9181b5e
comparison
equal deleted inserted replaced
90241:c293a93ebacf 90242:5e2d3828e89f
680 if (*x < x0 || *x >= x1) 680 if (*x < x0 || *x >= x1)
681 return ON_NOTHING; 681 return ON_NOTHING;
682 682
683 /* Outside any interesting column? */ 683 /* Outside any interesting column? */
684 if (*x < left_x || *x > right_x) 684 if (*x < left_x || *x > right_x)
685 return ON_SCROLL_BAR; 685 {
686 *y -= top_y;
687 return ON_SCROLL_BAR;
688 }
686 689
687 lmargin_width = window_box_width (w, LEFT_MARGIN_AREA); 690 lmargin_width = window_box_width (w, LEFT_MARGIN_AREA);
688 rmargin_width = window_box_width (w, RIGHT_MARGIN_AREA); 691 rmargin_width = window_box_width (w, RIGHT_MARGIN_AREA);
689 692
690 text_left = window_box_left (w, TEXT_AREA); 693 text_left = window_box_left (w, TEXT_AREA);
737 if (rmargin_width > 0 740 if (rmargin_width > 0
738 && (WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (w) 741 && (WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (w)
739 ? (*x < right_x - WINDOW_RIGHT_FRINGE_WIDTH (w)) 742 ? (*x < right_x - WINDOW_RIGHT_FRINGE_WIDTH (w))
740 : (*x >= right_x - rmargin_width))) 743 : (*x >= right_x - rmargin_width)))
741 { 744 {
742 *x -= right_x; 745 *x -= right_x - rmargin_width;
743 if (!WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (w)) 746 if (WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (w))
744 *x -= WINDOW_RIGHT_FRINGE_WIDTH (w); 747 *x += WINDOW_RIGHT_FRINGE_WIDTH (w);
745 *y -= top_y; 748 *y -= top_y;
746 return ON_RIGHT_MARGIN; 749 return ON_RIGHT_MARGIN;
747 } 750 }
748 751
749 /* Convert X and Y to window-relative pixel coordinates. */ 752 /* Convert X and Y to window-relative pixel coordinates. */
751 *y -= top_y; 754 *y -= top_y;
752 return ON_RIGHT_FRINGE; 755 return ON_RIGHT_FRINGE;
753 } 756 }
754 757
755 /* Everything special ruled out - must be on text area */ 758 /* Everything special ruled out - must be on text area */
756 *x -= left_x + WINDOW_LEFT_FRINGE_WIDTH (w); 759 *x -= text_left;
757 *y -= top_y; 760 *y -= top_y;
758 return ON_TEXT; 761 return ON_TEXT;
759 } 762 }
760 763
761 764
1027 return Qnil; 1030 return Qnil;
1028 #endif 1031 #endif
1029 1032
1030 if (! NILP (update) 1033 if (! NILP (update)
1031 && ! (! NILP (w->window_end_valid) 1034 && ! (! NILP (w->window_end_valid)
1032 && XFASTINT (w->last_modified) >= MODIFF)) 1035 && XFASTINT (w->last_modified) >= MODIFF)
1036 && !noninteractive)
1033 { 1037 {
1034 struct text_pos startp; 1038 struct text_pos startp;
1035 struct it it; 1039 struct it it;
1036 struct buffer *old_buffer = NULL, *b = XBUFFER (buf); 1040 struct buffer *old_buffer = NULL, *b = XBUFFER (buf);
1037 1041
6230 /*********************************************************************** 6234 /***********************************************************************
6231 Window Split Tree 6235 Window Split Tree
6232 ***********************************************************************/ 6236 ***********************************************************************/
6233 6237
6234 static Lisp_Object 6238 static Lisp_Object
6235 window_split_tree (w) 6239 window_tree (w)
6236 struct window *w; 6240 struct window *w;
6237 { 6241 {
6238 Lisp_Object tail = Qnil; 6242 Lisp_Object tail = Qnil;
6239 Lisp_Object result = Qnil; 6243 Lisp_Object result = Qnil;
6240 6244
6243 Lisp_Object wn; 6247 Lisp_Object wn;
6244 6248
6245 XSETWINDOW (wn, w); 6249 XSETWINDOW (wn, w);
6246 if (!NILP (w->hchild)) 6250 if (!NILP (w->hchild))
6247 wn = Fcons (Qnil, Fcons (Fwindow_edges (wn), 6251 wn = Fcons (Qnil, Fcons (Fwindow_edges (wn),
6248 window_split_tree (XWINDOW (w->hchild)))); 6252 window_tree (XWINDOW (w->hchild))));
6249 else if (!NILP (w->vchild)) 6253 else if (!NILP (w->vchild))
6250 wn = Fcons (Qt, Fcons (Fwindow_edges (wn), 6254 wn = Fcons (Qt, Fcons (Fwindow_edges (wn),
6251 window_split_tree (XWINDOW (w->vchild)))); 6255 window_tree (XWINDOW (w->vchild))));
6252 6256
6253 if (NILP (result)) 6257 if (NILP (result))
6254 { 6258 {
6255 result = tail = Fcons (wn, Qnil); 6259 result = tail = Fcons (wn, Qnil);
6256 } 6260 }
6266 return result; 6270 return result;
6267 } 6271 }
6268 6272
6269 6273
6270 6274
6271 DEFUN ("window-split-tree", Fwindow_split_tree, Swindow_split_tree, 6275 DEFUN ("window-tree", Fwindow_tree, Swindow_tree,
6272 0, 1, 0, 6276 0, 1, 0,
6273 doc: /* Return the window split tree for frame FRAME. 6277 doc: /* Return the window tree for frame FRAME.
6274 6278
6275 The return value is a list of the form (ROOT MINI), where ROOT 6279 The return value is a list of the form (ROOT MINI), where ROOT
6276 represents the window split tree of the frame's root window, and MINI 6280 represents the window tree of the frame's root window, and MINI
6277 is the frame's minibuffer window. 6281 is the frame's minibuffer window.
6278 6282
6279 If the root window is not split, ROOT is the root window itself. 6283 If the root window is not split, ROOT is the root window itself.
6280 Otherwise, ROOT is a list (DIR EDGES W1 W2 ...) where DIR is nil for a 6284 Otherwise, ROOT is a list (DIR EDGES W1 W2 ...) where DIR is nil for a
6281 horisontal split, and t for a vertical split, EDGES gives the combined 6285 horizontal split, and t for a vertical split, EDGES gives the combined
6282 size and position of the subwindows in the split, and the rest of the 6286 size and position of the subwindows in the split, and the rest of the
6283 elements are the subwindows in the split. Each of the subwindows may 6287 elements are the subwindows in the split. Each of the subwindows may
6284 again be a window or a list representing a window split, and so on. 6288 again be a window or a list representing a window split, and so on.
6285 EDGES is a list \(LEFT TOP RIGHT BOTTOM) as returned by `window-edges'. 6289 EDGES is a list \(LEFT TOP RIGHT BOTTOM) as returned by `window-edges'.
6286 6290
6299 f = XFRAME (frame); 6303 f = XFRAME (frame);
6300 6304
6301 if (!FRAME_LIVE_P (f)) 6305 if (!FRAME_LIVE_P (f))
6302 return Qnil; 6306 return Qnil;
6303 6307
6304 return window_split_tree (XWINDOW (FRAME_ROOT_WINDOW (f))); 6308 return window_tree (XWINDOW (FRAME_ROOT_WINDOW (f)));
6305 } 6309 }
6306 6310
6307 6311
6308 /*********************************************************************** 6312 /***********************************************************************
6309 Marginal Areas 6313 Marginal Areas
7108 defsubr (&Swindow_configuration_p); 7112 defsubr (&Swindow_configuration_p);
7109 defsubr (&Swindow_configuration_frame); 7113 defsubr (&Swindow_configuration_frame);
7110 defsubr (&Sset_window_configuration); 7114 defsubr (&Sset_window_configuration);
7111 defsubr (&Scurrent_window_configuration); 7115 defsubr (&Scurrent_window_configuration);
7112 defsubr (&Ssave_window_excursion); 7116 defsubr (&Ssave_window_excursion);
7113 defsubr (&Swindow_split_tree); 7117 defsubr (&Swindow_tree);
7114 defsubr (&Sset_window_margins); 7118 defsubr (&Sset_window_margins);
7115 defsubr (&Swindow_margins); 7119 defsubr (&Swindow_margins);
7116 defsubr (&Sset_window_fringes); 7120 defsubr (&Sset_window_fringes);
7117 defsubr (&Swindow_fringes); 7121 defsubr (&Swindow_fringes);
7118 defsubr (&Sset_window_scroll_bars); 7122 defsubr (&Sset_window_scroll_bars);