Mercurial > emacs
comparison src/frame.c @ 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 | 840bd675fd85 |
children | 6358f03eb003 |
comparison
equal
deleted
inserted
replaced
97448:c8189c33c2e6 | 97449:d3a738f747c6 |
---|---|
65 | 65 |
66 /* Lower limit value of the frame opacity (alpha transparency). */ | 66 /* Lower limit value of the frame opacity (alpha transparency). */ |
67 | 67 |
68 Lisp_Object Vframe_alpha_lower_limit; | 68 Lisp_Object Vframe_alpha_lower_limit; |
69 | 69 |
70 #endif | |
71 | |
72 #ifdef HAVE_NS | |
73 Lisp_Object Qns_parse_geometry; | |
70 #endif | 74 #endif |
71 | 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; |
4048 } | 4052 } |
4049 | 4053 |
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) ... ). |
4056 The properties returned may include `top', `left', `height', and `width'. | 4079 The properties returned may include `top', `left', `height', and `width'. |
4057 The value of `left' or `top' may be an integer, | 4080 The value of `left' or `top' may be an integer, |
4066 | 4089 |
4067 CHECK_STRING (string); | 4090 CHECK_STRING (string); |
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 { |
4080 Lisp_Object element; | 4097 Lisp_Object element; |
4081 | 4098 |
4106 if (geometry & HeightValue) | 4123 if (geometry & HeightValue) |
4107 result = Fcons (Fcons (Qheight, make_number (height)), result); | 4124 result = Fcons (Fcons (Qheight, make_number (height)), result); |
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. |
4114 | 4133 |
4115 Also set the win_gravity and size_hint_flags of F. | 4134 Also set the win_gravity and size_hint_flags of F. |
4413 Qterminal = intern ("terminal"); | 4432 Qterminal = intern ("terminal"); |
4414 staticpro (&Qterminal); | 4433 staticpro (&Qterminal); |
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 |
4421 for (i = 0; i < sizeof (frame_parms) / sizeof (frame_parms[0]); i++) | 4445 for (i = 0; i < sizeof (frame_parms) / sizeof (frame_parms[0]); i++) |
4422 { | 4446 { |