changeset 50367:169f9122da43

Remove extern decl for frame parameter vars. (change_window_heights): New generic function; replaces x_change_window_heights. All users changed.
author Kim F. Storm <storm@cua.dk>
date Mon, 31 Mar 2003 20:35:51 +0000
parents b8a179bd89b1
children d7a1f1ee84e9
files src/window.c
diffstat 1 files changed, 29 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/window.c	Mon Mar 31 20:35:43 2003 +0000
+++ b/src/window.c	Mon Mar 31 20:35:51 2003 +0000
@@ -52,7 +52,6 @@
 Lisp_Object Qwindowp, Qwindow_live_p, Qwindow_configuration_p;
 Lisp_Object Qwindow_size_fixed;
 extern Lisp_Object Qleft_margin, Qright_margin;
-extern Lisp_Object Qheight, Qwidth;
 
 static int displayed_window_lines P_ ((struct window *));
 static struct window *decode_window P_ ((Lisp_Object));
@@ -2639,6 +2638,35 @@
   size_window (window, width, 1, nodelete);
 }
 
+/* Change window heights in windows rooted in WINDOW by N lines.  */
+
+void
+change_window_heights (window, n)
+     Lisp_Object window;
+     int n;
+{
+  struct window *w = XWINDOW (window);
+
+  XSETFASTINT (w->top, XFASTINT (w->top) + n);
+  XSETFASTINT (w->height, XFASTINT (w->height) - n);
+
+  if (INTEGERP (w->orig_top))
+    XSETFASTINT (w->orig_top, XFASTINT (w->orig_top) + n);
+  if (INTEGERP (w->orig_height))
+    XSETFASTINT (w->orig_height, XFASTINT (w->orig_height) - n);
+
+  /* Handle just the top child in a vertical split.  */
+  if (!NILP (w->vchild))
+    change_window_heights (w->vchild, n);
+
+  /* Adjust all children in a horizontal split.  */
+  for (window = w->hchild; !NILP (window); window = w->next)
+    {
+      w = XWINDOW (window);
+      change_window_heights (window, n);
+    }
+}
+
 
 int window_select_count;