diff options
| -rw-r--r-- | src/frame.c | 36 |
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 | ||
| 73 | Lisp_Object Qns_parse_geometry; | ||
| 74 | #endif | ||
| 75 | |||
| 72 | Lisp_Object Qframep, Qframe_live_p; | 76 | Lisp_Object Qframep, Qframe_live_p; |
| 73 | Lisp_Object Qicon, Qmodeline; | 77 | Lisp_Object Qicon, Qmodeline; |
| 74 | Lisp_Object Qonly; | 78 | Lisp_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 | |||
| 4063 | DEFUN ("x-parse-geometry", Fx_parse_geometry, Sx_parse_geometry, 1, 1, 0, | ||
| 4064 | doc: /* Parse a Nextstep-style geometry string STRING. | ||
| 4065 | Returns an alist of the form ((top . TOP), (left . LEFT) ... ). | ||
| 4066 | The properties returned may include `top', `left', `height', and `width'. | ||
| 4067 | This 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 | |||
| 4053 | DEFUN ("x-parse-geometry", Fx_parse_geometry, Sx_parse_geometry, 1, 1, 0, | 4076 | DEFUN ("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. |
| 4055 | Returns an alist of the form ((top . TOP), (left . LEFT) ... ). | 4078 | Returns 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 | ||