comparison src/window.c @ 4990:8f0cf4fd3d2c

Automatic merge
author Ben Wing <ben@xemacs.org>
date Sat, 06 Feb 2010 04:01:46 -0600
parents 0d4c9d0f6a8d
children d0c14ea98592 6f2158fa75ed b5df3737028a
comparison
equal deleted inserted replaced
4989:d2ec55325515 4990:8f0cf4fd3d2c
316 Lisp_Object buf; 316 Lisp_Object buf;
317 317
318 if (print_readably) 318 if (print_readably)
319 printing_unreadable_lcrecord (obj, 0); 319 printing_unreadable_lcrecord (obj, 0);
320 320
321 write_c_string (printcharfun, "#<window"); 321 write_ascstring (printcharfun, "#<window");
322 buf = XWINDOW_BUFFER (obj); 322 buf = XWINDOW_BUFFER (obj);
323 if (EQ (buf, Qt)) 323 if (EQ (buf, Qt))
324 write_c_string (printcharfun, " during creation"); 324 write_ascstring (printcharfun, " during creation");
325 else if (!NILP (buf)) 325 else if (!NILP (buf))
326 { 326 {
327 327
328 Lisp_Object name = XBUFFER (buf)->name; 328 Lisp_Object name = XBUFFER (buf)->name;
329 write_fmt_string_lisp (printcharfun, " on %S", 1, name); 329 write_fmt_string_lisp (printcharfun, " on %S", 1, name);
1046 else 1046 else
1047 return XINT (w->vertical_divider_line_width) == 0 ? 0 : 1; 1047 return XINT (w->vertical_divider_line_width) == 0 ? 0 : 1;
1048 } 1048 }
1049 1049
1050 int 1050 int
1051 window_scrollbar_width (struct window *w) 1051 window_scrollbar_width (struct window * USED_IF_SCROLLBARS (w))
1052 { 1052 {
1053 #ifdef HAVE_SCROLLBARS 1053 #ifdef HAVE_SCROLLBARS
1054 if (!WINDOW_WIN_P (w) 1054 if (!WINDOW_WIN_P (w)
1055 || MINI_WINDOW_P (w) 1055 || MINI_WINDOW_P (w)
1056 || NILP (w->buffer) 1056 || NILP (w->buffer)
1065 } 1065 }
1066 1066
1067 /* Horizontal scrollbars are only active on windows with truncation 1067 /* Horizontal scrollbars are only active on windows with truncation
1068 turned on. */ 1068 turned on. */
1069 int 1069 int
1070 window_scrollbar_height (struct window *w) 1070 window_scrollbar_height (struct window * USED_IF_SCROLLBARS (w))
1071 { 1071 {
1072 #ifdef HAVE_SCROLLBARS 1072 #ifdef HAVE_SCROLLBARS
1073 if (!WINDOW_WIN_P (w) 1073 if (!WINDOW_WIN_P (w)
1074 || MINI_WINDOW_P (w) 1074 || MINI_WINDOW_P (w)
1075 || NILP (w->buffer) 1075 || NILP (w->buffer)
1123 up-to-date than CURRENT_DISP. For calls to this outside 1123 up-to-date than CURRENT_DISP. For calls to this outside
1124 of redisplay it doesn't matter which structure we check 1124 of redisplay it doesn't matter which structure we check
1125 since there is a redisplay condition that these 1125 since there is a redisplay condition that these
1126 structures be identical outside of redisplay. */ 1126 structures be identical outside of redisplay. */
1127 dla = window_display_lines (w, DESIRED_DISP); 1127 dla = window_display_lines (w, DESIRED_DISP);
1128 if (dla && Dynarr_length (dla) && Dynarr_atp (dla, 0)->modeline) 1128 if (dla && Dynarr_length (dla) && Dynarr_begin (dla)->modeline)
1129 modeline_height = (Dynarr_atp (dla, 0)->ascent + 1129 modeline_height = (Dynarr_begin (dla)->ascent +
1130 Dynarr_atp (dla, 0)->descent); 1130 Dynarr_begin (dla)->descent);
1131 else 1131 else
1132 { 1132 {
1133 dla = window_display_lines (w, CURRENT_DISP); 1133 dla = window_display_lines (w, CURRENT_DISP);
1134 if (dla && Dynarr_length (dla) && Dynarr_atp (dla, 0)->modeline) 1134 if (dla && Dynarr_length (dla) && Dynarr_begin (dla)->modeline)
1135 modeline_height = (Dynarr_atp (dla, 0)->ascent + 1135 modeline_height = (Dynarr_begin (dla)->ascent +
1136 Dynarr_atp (dla, 0)->descent); 1136 Dynarr_begin (dla)->descent);
1137 else 1137 else
1138 /* This should be an abort except I'm not yet 100% 1138 /* This should be an abort except I'm not yet 100%
1139 confident that it won't ever get hit (though I 1139 confident that it won't ever get hit (though I
1140 haven't been able to trigger it). It is extremely 1140 haven't been able to trigger it). It is extremely
1141 unlikely to cause any noticeable problem and even if 1141 unlikely to cause any noticeable problem and even if
1272 { 1272 {
1273 return window_bottom_window_gutter_height (w); 1273 return window_bottom_window_gutter_height (w);
1274 } 1274 }
1275 1275
1276 static int 1276 static int
1277 window_left_window_gutter_width (struct window *w, int modeline) 1277 window_left_window_gutter_width (struct window *w,
1278 int USED_IF_SCROLLBARS (modeline))
1278 { 1279 {
1279 if (!NILP (w->hchild) || !NILP (w->vchild)) 1280 if (!NILP (w->hchild) || !NILP (w->vchild))
1280 return 0; 1281 return 0;
1281 1282
1282 #ifdef HAVE_SCROLLBARS 1283 #ifdef HAVE_SCROLLBARS
1292 { 1293 {
1293 return window_left_window_gutter_width (w, modeline); 1294 return window_left_window_gutter_width (w, modeline);
1294 } 1295 }
1295 1296
1296 static int 1297 static int
1297 window_right_window_gutter_width (struct window *w, int modeline) 1298 window_right_window_gutter_width (struct window *w,
1299 int USED_IF_SCROLLBARS (modeline))
1298 { 1300 {
1299 int gutter = 0; 1301 int gutter = 0;
1300 1302
1301 if (!NILP (w->hchild) || !NILP (w->vchild)) 1303 if (!NILP (w->hchild) || !NILP (w->vchild))
1302 return 0; 1304 return 0;
1919 display_line_dynarr *dla = window_display_lines (w, CURRENT_DISP); 1921 display_line_dynarr *dla = window_display_lines (w, CURRENT_DISP);
1920 int num_lines = Dynarr_length (dla); 1922 int num_lines = Dynarr_length (dla);
1921 struct display_line *dl; 1923 struct display_line *dl;
1922 1924
1923 /* No lines - no clipped lines */ 1925 /* No lines - no clipped lines */
1924 if (num_lines == 0 || (num_lines == 1 && Dynarr_atp (dla, 0)->modeline)) 1926 if (num_lines == 0 || (num_lines == 1 && Dynarr_begin (dla)->modeline))
1925 return Qnil; 1927 return Qnil;
1926 1928
1927 dl = Dynarr_atp (dla, num_lines - 1); 1929 dl = Dynarr_atp (dla, num_lines - 1);
1928 if (dl->clip == 0) 1930 if (dl->clip == 0)
1929 return Qnil; 1931 return Qnil;
4205 4207
4206 /* #### Document and assert somewhere that w->window_end_pos == -1 4208 /* #### Document and assert somewhere that w->window_end_pos == -1
4207 indicates that end-of-buffer is being displayed. */ 4209 indicates that end-of-buffer is being displayed. */
4208 if (end_pos == -1) 4210 if (end_pos == -1)
4209 { 4211 {
4210 struct display_line *dl = Dynarr_atp (dla, 0); 4212 struct display_line *dl = Dynarr_begin (dla);
4211 int ypos1 = dl->ypos + dl->descent; 4213 int ypos1 = dl->ypos + dl->descent;
4212 int ypos2 = WINDOW_TEXT_BOTTOM (w); 4214 int ypos2 = WINDOW_TEXT_BOTTOM (w);
4213 Lisp_Object window; 4215 Lisp_Object window;
4214 int defheight, defwidth; 4216 int defheight, defwidth;
4215 4217
4240 if (defheight) 4242 if (defheight)
4241 num_lines += ((ypos2 - ypos1) / defheight); 4243 num_lines += ((ypos2 - ypos1) / defheight);
4242 } 4244 }
4243 else 4245 else
4244 { 4246 {
4245 if (num_lines > 1 && Dynarr_atp (dla, 0)->modeline) 4247 if (num_lines > 1 && Dynarr_begin (dla)->modeline)
4246 num_lines--; 4248 num_lines--;
4247 4249
4248 if (scroll_on_clipped_lines 4250 if (scroll_on_clipped_lines
4249 && Dynarr_atp (dla, Dynarr_length (dla) - 1)->clip) 4251 && Dynarr_atp (dla, Dynarr_length (dla) - 1)->clip)
4250 num_lines--; 4252 num_lines--;
4613 fheight = XINT (Vwindow_pixel_scroll_increment); 4615 fheight = XINT (Vwindow_pixel_scroll_increment);
4614 else if (!NILP (Vwindow_pixel_scroll_increment)) 4616 else if (!NILP (Vwindow_pixel_scroll_increment))
4615 default_face_height_and_width (window, &fheight, &fwidth); 4617 default_face_height_and_width (window, &fheight, &fwidth);
4616 4618
4617 if (Dynarr_length (dla) >= 1) 4619 if (Dynarr_length (dla) >= 1)
4618 modeline = Dynarr_atp (dla, 0)->modeline; 4620 modeline = Dynarr_begin (dla)->modeline;
4619 4621
4620 dl = Dynarr_atp (dla, modeline); 4622 dl = Dynarr_atp (dla, modeline);
4621 4623
4622 if (value > 0) 4624 if (value > 0)
4623 { 4625 {
5301 pos = Fwindow_point (window); 5303 pos = Fwindow_point (window);
5302 5304
5303 CHECK_INT (pos); 5305 CHECK_INT (pos);
5304 point = XINT (pos); 5306 point = XINT (pos);
5305 5307
5306 if (Dynarr_length (dla) && Dynarr_atp (dla, 0)->modeline) 5308 if (Dynarr_length (dla) && Dynarr_begin (dla)->modeline)
5307 first_line = 1; 5309 first_line = 1;
5308 else 5310 else
5309 first_line = 0; 5311 first_line = 0;
5310 5312
5311 for (i = first_line; i < Dynarr_length (dla); i++) 5313 for (i = first_line; i < Dynarr_length (dla); i++)