aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChong Yidong2008-08-13 23:43:22 +0000
committerChong Yidong2008-08-13 23:43:22 +0000
commitdc4db71c2326979b613d2d5bb82f5ac6dcd5075c (patch)
tree3a205429a04953f4da8984d79dd31a2fc909b439 /src
parent01623ee7a02f171f1deaabbfeb431265fdd77713 (diff)
downloademacs-dc4db71c2326979b613d2d5bb82f5ac6dcd5075c.tar.gz
emacs-dc4db71c2326979b613d2d5bb82f5ac6dcd5075c.zip
(Qns_parse_geometry): New var.
(Fx_parse_geometry): For HAVE_NS, call ns-parse-geometry.
Diffstat (limited to 'src')
-rw-r--r--src/frame.c36
1 files changed, 30 insertions, 6 deletions
diff --git a/src/frame.c b/src/frame.c
index 448f6bab918..7e482d6a5da 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -69,6 +69,10 @@ Lisp_Object Vframe_alpha_lower_limit;
69 69
70#endif 70#endif
71 71
72#ifdef HAVE_NS
73Lisp_Object Qns_parse_geometry;
74#endif
75
72Lisp_Object Qframep, Qframe_live_p; 76Lisp_Object Qframep, Qframe_live_p;
73Lisp_Object Qicon, Qmodeline; 77Lisp_Object Qicon, Qmodeline;
74Lisp_Object Qonly; 78Lisp_Object Qonly;
@@ -4050,6 +4054,25 @@ x_default_parameter (f, alist, prop, deflt, xprop, xclass, type)
4050 4054
4051 4055
4052 4056
4057#ifdef HAVE_NS
4058
4059/* We used to define x-parse-geometry directly in ns-win.el, but that
4060 confused make-docfile: the documentation string in ns-win.el was
4061 used for x-parse-geometry even in non-NS builds.. */
4062
4063DEFUN ("x-parse-geometry", Fx_parse_geometry, Sx_parse_geometry, 1, 1, 0,
4064 doc: /* Parse a Nextstep-style geometry string STRING.
4065Returns an alist of the form ((top . TOP), (left . LEFT) ... ).
4066The properties returned may include `top', `left', `height', and `width'.
4067This works by calling `ns-parse-geometry'. */)
4068 (string)
4069 Lisp_Object string;
4070{
4071 call1 (Qns_parse_geometry, string);
4072}
4073
4074#else /* !HAVE_NS */
4075
4053DEFUN ("x-parse-geometry", Fx_parse_geometry, Sx_parse_geometry, 1, 1, 0, 4076DEFUN ("x-parse-geometry", Fx_parse_geometry, Sx_parse_geometry, 1, 1, 0,
4054 doc: /* Parse an X-style geometry string STRING. 4077 doc: /* Parse an X-style geometry string STRING.
4055Returns an alist of the form ((top . TOP), (left . LEFT) ... ). 4078Returns an alist of the form ((top . TOP), (left . LEFT) ... ).
@@ -4068,12 +4091,6 @@ or a list (- N) meaning -N pixels relative to bottom/right corner. */)
4068 4091
4069 geometry = XParseGeometry ((char *) SDATA (string), 4092 geometry = XParseGeometry ((char *) SDATA (string),
4070 &x, &y, &width, &height); 4093 &x, &y, &width, &height);
4071
4072#if 0
4073 if (!!(geometry & XValue) != !!(geometry & YValue))
4074 error ("Must specify both x and y position, or neither");
4075#endif
4076
4077 result = Qnil; 4094 result = Qnil;
4078 if (geometry & XValue) 4095 if (geometry & XValue)
4079 { 4096 {
@@ -4108,6 +4125,8 @@ or a list (- N) meaning -N pixels relative to bottom/right corner. */)
4108 4125
4109 return result; 4126 return result;
4110} 4127}
4128#endif /* HAVE_NS */
4129
4111 4130
4112/* Calculate the desired size and position of frame F. 4131/* Calculate the desired size and position of frame F.
4113 Return the flags saying which aspects were specified. 4132 Return the flags saying which aspects were specified.
@@ -4415,6 +4434,11 @@ syms_of_frame ()
4415 Qterminal_live_p = intern ("terminal-live-p"); 4434 Qterminal_live_p = intern ("terminal-live-p");
4416 staticpro (&Qterminal_live_p); 4435 staticpro (&Qterminal_live_p);
4417 4436
4437#ifdef HAVE_NS
4438 Qns_parse_geometry = intern ("ns-parse-geometry");
4439 staticpro (&Qns_parse_geometry);
4440#endif
4441
4418 { 4442 {
4419 int i; 4443 int i;
4420 4444