diff src/gui.c @ 231:557eaa0339bf r20-5b14

Import from CVS: tag r20-5b14
author cvs
date Mon, 13 Aug 2007 10:13:48 +0200
parents 2d532a89d707
children 677f6a0ee643
line wrap: on
line diff
--- a/src/gui.c	Mon Aug 13 10:13:03 2007 +0200
+++ b/src/gui.c	Mon Aug 13 10:13:48 2007 +0200
@@ -23,6 +23,7 @@
 /* Synched up with: Not in FSF. */
 
 #include <config.h>
+#include "gui.h"
 #include "lisp.h"
 
 Lisp_Object Q_active, Q_suffix, Q_keys, Q_style, Q_selected;
@@ -30,6 +31,40 @@
 Lisp_Object Q_accelerator;
 Lisp_Object Qtoggle, Qradio;
 
+#ifdef HAVE_POPUPS
+
+/* count of menus/dboxes currently up */
+int popup_up_p;
+
+DEFUN ("popup-up-p", Fpopup_up_p, 0, 0, 0, /*
+Return t if a popup menu or dialog box is up, nil otherwise.
+See `popup-menu' and `popup-dialog-box'.
+*/
+       ())
+{
+  return popup_up_p ? Qt : Qnil;
+}
+
+int
+separator_string_p (CONST char *s)
+{
+  CONST char *p;
+  char first;
+
+  if (!s || s[0] == '\0')
+    return 0;
+  first = s[0];
+  if (first != '-' && first != '=')
+    return 0;
+  for (p = s; *p == first; p++);
+
+  if (*p == '!' || *p == ':' || *p == '\0')
+    return 1;
+  return 0;
+}
+
+#endif /* HAVE_POPUPS */
+
 void
 syms_of_gui (void)
 {
@@ -45,6 +80,10 @@
 
   defsymbol (&Qtoggle, "toggle");
   defsymbol (&Qradio, "radio");
+
+#ifdef HAVE_POPUPS
+  DEFSUBR (Fpopup_up_p);
+#endif
 }
 
 void