summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerd Moellmann <gerd@gnu.org>2001-01-22 15:17:50 +0000
committerGerd Moellmann <gerd@gnu.org>2001-01-22 15:17:50 +0000
commit57c28064ec94eb47731713517c910bdbda84a34e (patch)
tree663a4d23f6d4310cdd2f5c907b04a7b915d1dc8a
parent57760935c1e3e53aad96a4ab82b42ec2df7eb634 (diff)
downloademacs-57c28064ec94eb47731713517c910bdbda84a34e.tar.gz
emacs-57c28064ec94eb47731713517c910bdbda84a34e.tar.bz2
emacs-57c28064ec94eb47731713517c910bdbda84a34e.zip
(Ftool_bar_lines_needed): New function.
(syms_of_xdisp): Defsubr it.
-rw-r--r--src/ChangeLog3
-rw-r--r--src/xdisp.c33
2 files changed, 36 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index f85dd0e7602..b4db657e1f3 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,8 @@
2001-01-22 Gerd Moellmann <gerd@gnu.org>
+ * xdisp.c (Ftool_bar_lines_needed): New function.
+ (syms_of_xdisp): Defsubr it.
+
* editfns.c (Fformat): Don't extend text properties from arguments
to padding chars in the result.
diff --git a/src/xdisp.c b/src/xdisp.c
index 0e6e6d32484..78515968823 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -7411,6 +7411,38 @@ tool_bar_lines_needed (f)
}
+DEFUN ("tool-bar-lines-needed", Ftool_bar_lines_needed, Stool_bar_lines_needed,
+ 0, 1, 0,
+ "Return the number of lines occupied by the tool bar of FRAME.")
+ (frame)
+ Lisp_Object frame;
+{
+ struct frame *f;
+ struct window *w;
+ int nlines = 0;
+
+ if (NILP (frame))
+ frame = selected_frame;
+ else
+ CHECK_FRAME (frame, 0);
+ f = XFRAME (frame);
+
+ if (WINDOWP (f->tool_bar_window)
+ || (w = XWINDOW (f->tool_bar_window),
+ XFASTINT (w->height) > 0))
+ {
+ update_tool_bar (f, 1);
+ if (f->n_tool_bar_items)
+ {
+ build_desired_tool_bar_string (f);
+ nlines = tool_bar_lines_needed (f);
+ }
+ }
+
+ return make_number (nlines);
+}
+
+
/* Display the tool-bar of frame F. Value is non-zero if tool-bar's
height should be changed. */
@@ -13929,6 +13961,7 @@ syms_of_xdisp ()
defsubr (&Strace_redisplay_toggle);
defsubr (&Strace_to_stderr);
#endif
+ defsubr (&Stool_bar_lines_needed);
staticpro (&Qmenu_bar_update_hook);
Qmenu_bar_update_hook = intern ("menu-bar-update-hook");