]> code.delx.au - gnu-emacs/commitdiff
(x_change_window_heights): New function.
authorJason Rumney <jasonr@gnu.org>
Fri, 24 Nov 2000 21:31:14 +0000 (21:31 +0000)
committerJason Rumney <jasonr@gnu.org>
Fri, 24 Nov 2000 21:31:14 +0000 (21:31 +0000)
src/w32fns.c

index a3f5d8bf0acddd655e551e15deb76d13bf6b9e2f..6ab167a32404a6e6c9877ad0ce6960d2da279e72 100644 (file)
@@ -2472,6 +2472,36 @@ x_set_visibility (f, value, oldval)
     Fmake_frame_visible (frame);
 }
 
+\f
+/* Change window heights in windows rooted in WINDOW by N lines.  */
+
+static void
+x_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))
+    x_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);
+      x_change_window_heights (window, n);
+    }
+}
+
 void
 x_set_menu_bar_lines (f, value, oldval)
      struct frame *f;