comparison src/window.c @ 251:677f6a0ee643 r20-5b24

Import from CVS: tag r20-5b24
author cvs
date Mon, 13 Aug 2007 10:19:59 +0200
parents 2c611d1463a6
children 084402c475ba
comparison
equal deleted inserted replaced
250:f385a461c9aa 251:677f6a0ee643
1371 MARK_CLIP_CHANGED; /* FSF marks differently but we aren't FSF. */ 1371 MARK_CLIP_CHANGED; /* FSF marks differently but we aren't FSF. */
1372 w->hscroll = ncols; 1372 w->hscroll = ncols;
1373 return ncol; 1373 return ncol;
1374 } 1374 }
1375 1375
1376 #if 0 /* bogus RMS crock */ 1376 #if 0 /* bogus crock */
1377 1377
1378 xxDEFUN ("window-redisplay-end-trigger", 1378 xxDEFUN ("window-redisplay-end-trigger",
1379 Fwindow_redisplay_end_trigger, 0, 1, 0, /* 1379 Fwindow_redisplay_end_trigger, 0, 1, 0, /*
1380 Return WINDOW's redisplay end trigger value. 1380 Return WINDOW's redisplay end trigger value.
1381 See `set-window-redisplay-end-trigger' for more information. 1381 See `set-window-redisplay-end-trigger' for more information.
4287 int retval; 4287 int retval;
4288 4288
4289 for (; !NILP (window); window = XWINDOW (window)->next) 4289 for (; !NILP (window); window = XWINDOW (window)->next)
4290 { 4290 {
4291 struct window *w = XWINDOW (window); 4291 struct window *w = XWINDOW (window);
4292
4292 if (!NILP (w->vchild)) 4293 if (!NILP (w->vchild))
4293 retval = map_windows_1 (w->vchild, mapfun, closure); 4294 retval = map_windows_1 (w->vchild, mapfun, closure);
4294 else if (!NILP (w->hchild)) 4295 else if (!NILP (w->hchild))
4295 retval = map_windows_1 (w->hchild, mapfun, closure); 4296 retval = map_windows_1 (w->hchild, mapfun, closure);
4296 else 4297 else
4297 retval = (mapfun) (w, closure); 4298 retval = (mapfun) (w, closure);
4298 if (retval) 4299 if (retval)
4299 return retval; 4300 return retval;
4300 } 4301 }
4301 4302
4302 return 0; 4303 return retval;
4303 } 4304 }
4304 4305
4305 /* Map MAPFUN over the windows in F. CLOSURE is passed to each 4306 /* Map MAPFUN over the windows in F. CLOSURE is passed to each
4306 invocation of MAPFUN. If any invocation of MAPFUN returns non-zero, 4307 invocation of MAPFUN. If any invocation of MAPFUN returns
4307 the mapping is halted and the value returned is the return value 4308 non-zero, the mapping is halted. Otherwise, map_windows() maps
4308 of map_windows(). Otherwise, map_windows() maps over all windows 4309 over all windows in F.
4309 in F and returns 0. */ 4310
4310 4311 If MAPFUN create or delete windows, the behaviour is undefined. */
4311 int 4312
4313 void
4312 map_windows (struct frame *f, int (*mapfun) (struct window *w, void *closure), 4314 map_windows (struct frame *f, int (*mapfun) (struct window *w, void *closure),
4313 void *closure) 4315 void *closure)
4314 { 4316 {
4315 return map_windows_1 (FRAME_ROOT_WINDOW (f), mapfun, closure); 4317 if (f)
4318 map_windows_1 (FRAME_ROOT_WINDOW (f), mapfun, closure);
4319 else
4320 {
4321 Lisp_Object frmcons, devcons, concons;
4322
4323 FRAME_LOOP_NO_BREAK(frmcons, devcons, concons)
4324 {
4325 if (map_windows_1 (FRAME_ROOT_WINDOW (XFRAME (XCAR (frmcons))),
4326 mapfun, closure))
4327 return;
4328 }
4329 }
4316 } 4330 }
4317 4331
4318 4332
4319 static void 4333 static void
4320 modeline_shadow_thickness_changed (Lisp_Object specifier, struct window *w, 4334 modeline_shadow_thickness_changed (Lisp_Object specifier, struct window *w,
4624 (obj)) 4638 (obj))
4625 { 4639 {
4626 return WINDOW_CONFIGURATIONP (obj) ? Qt : Qnil; 4640 return WINDOW_CONFIGURATIONP (obj) ? Qt : Qnil;
4627 } 4641 }
4628 4642
4629 /* 4643 static int
4630 * There are getting to be a lot of functions which traverse the 4644 mark_windows_in_use_closure (struct window *w, void *closure)
4631 * window structure doing various things. It may be worth writing a 4645 {
4632 * generic map-windows function. 4646 int mark = *(int *)closure;
4633 * #### I just did. Feel free to rewrite. --ben 4647 w->config_mark = mark;
4634 */ 4648 return 0;
4635 void 4649 }
4636 mark_windows_in_use (Lisp_Object window, int mark) 4650
4637 { 4651 static void
4638 for (; !NILP (window) ; window = XWINDOW (window)->next) 4652 mark_windows_in_use (struct frame *f, int mark)
4639 { 4653 {
4640 XWINDOW (window)->config_mark = mark; 4654 map_windows (f, mark_windows_in_use_closure, &mark);
4641
4642 if (!NILP (XWINDOW (window)->vchild))
4643 mark_windows_in_use (XWINDOW (window)->vchild, mark);
4644 else if (!NILP (XWINDOW (window)->hchild))
4645 mark_windows_in_use (XWINDOW (window)->hchild, mark);
4646 }
4647 } 4655 }
4648 4656
4649 /* Lisp_Object return value so it can be used in record_unwind_protect() */ 4657 /* Lisp_Object return value so it can be used in record_unwind_protect() */
4650 static Lisp_Object 4658 static Lisp_Object
4651 free_window_configuration (Lisp_Object window_config) 4659 free_window_configuration (Lisp_Object window_config)
4769 investigation of the frame state, which may crash if the frame is 4777 investigation of the frame state, which may crash if the frame is
4770 in an inconsistent state. */ 4778 in an inconsistent state. */
4771 begin_dont_check_for_quit (); 4779 begin_dont_check_for_quit ();
4772 record_unwind_protect (free_window_configuration, old_window_config); 4780 record_unwind_protect (free_window_configuration, old_window_config);
4773 4781
4774 mark_windows_in_use (f->root_window, 1); 4782 mark_windows_in_use (f, 1);
4775 4783
4776 previous_frame_width = FRAME_WIDTH (f); 4784 previous_frame_width = FRAME_WIDTH (f);
4777 previous_frame_height = FRAME_HEIGHT (f); 4785 previous_frame_height = FRAME_HEIGHT (f);
4778 /* If the frame has been resized since this window configuration was 4786 /* If the frame has been resized since this window configuration was
4779 made, we change the frame to the size specified in the 4787 made, we change the frame to the size specified in the
5324 DEFSUBR (Fwindow_displayed_height); 5332 DEFSUBR (Fwindow_displayed_height);
5325 DEFSUBR (Fwindow_width); 5333 DEFSUBR (Fwindow_width);
5326 DEFSUBR (Fwindow_pixel_height); 5334 DEFSUBR (Fwindow_pixel_height);
5327 DEFSUBR (Fwindow_pixel_width); 5335 DEFSUBR (Fwindow_pixel_width);
5328 DEFSUBR (Fwindow_hscroll); 5336 DEFSUBR (Fwindow_hscroll);
5329 #if 0 /* bogus RMS crock */ 5337 #if 0 /* bogus crock */
5330 DEFSUBR (Fwindow_redisplay_end_trigger); 5338 DEFSUBR (Fwindow_redisplay_end_trigger);
5331 DEFSUBR (Fset_window_redisplay_end_trigger); 5339 DEFSUBR (Fset_window_redisplay_end_trigger);
5332 #endif 5340 #endif
5333 DEFSUBR (Fset_window_hscroll); 5341 DEFSUBR (Fset_window_hscroll);
5334 DEFSUBR (Fwindow_pixel_edges); 5342 DEFSUBR (Fwindow_pixel_edges);