changeset 97449:d3a738f747c6

(Qns_parse_geometry): New var. (Fx_parse_geometry): For HAVE_NS, call ns-parse-geometry.
author Chong Yidong <cyd@stupidchicken.com>
date Wed, 13 Aug 2008 23:43:22 +0000
parents c8189c33c2e6
children e3dbd401e0f4
files src/frame.c
diffstat 1 files changed, 30 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/frame.c	Wed Aug 13 23:40:17 2008 +0000
+++ b/src/frame.c	Wed Aug 13 23:43:22 2008 +0000
@@ -69,6 +69,10 @@
 
 #endif
 
+#ifdef HAVE_NS
+Lisp_Object Qns_parse_geometry;
+#endif
+
 Lisp_Object Qframep, Qframe_live_p;
 Lisp_Object Qicon, Qmodeline;
 Lisp_Object Qonly;
@@ -4050,6 +4054,25 @@
 
 
 
+#ifdef HAVE_NS
+
+/* We used to define x-parse-geometry directly in ns-win.el, but that
+   confused make-docfile: the documentation string in ns-win.el was
+   used for x-parse-geometry even in non-NS builds..  */
+
+DEFUN ("x-parse-geometry", Fx_parse_geometry, Sx_parse_geometry, 1, 1, 0,
+       doc: /* Parse a Nextstep-style geometry string STRING.
+Returns an alist of the form ((top . TOP), (left . LEFT) ... ).
+The properties returned may include `top', `left', `height', and `width'.
+This works by calling `ns-parse-geometry'.  */)
+     (string)
+     Lisp_Object string;
+{
+  call1 (Qns_parse_geometry, string);
+}
+
+#else /* !HAVE_NS */
+
 DEFUN ("x-parse-geometry", Fx_parse_geometry, Sx_parse_geometry, 1, 1, 0,
        doc: /* Parse an X-style geometry string STRING.
 Returns an alist of the form ((top . TOP), (left . LEFT) ... ).
@@ -4068,12 +4091,6 @@
 
   geometry = XParseGeometry ((char *) SDATA (string),
 			     &x, &y, &width, &height);
-
-#if 0
-  if (!!(geometry & XValue) != !!(geometry & YValue))
-    error ("Must specify both x and y position, or neither");
-#endif
-
   result = Qnil;
   if (geometry & XValue)
     {
@@ -4108,6 +4125,8 @@
 
   return result;
 }
+#endif /* HAVE_NS */
+
 
 /* Calculate the desired size and position of frame F.
    Return the flags saying which aspects were specified.
@@ -4415,6 +4434,11 @@
   Qterminal_live_p = intern ("terminal-live-p");
   staticpro (&Qterminal_live_p);
 
+#ifdef HAVE_NS
+  Qns_parse_geometry = intern ("ns-parse-geometry");
+  staticpro (&Qns_parse_geometry);
+#endif
+
   {
     int i;