diff options
| author | Richard M. Stallman | 1996-09-10 20:00:25 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1996-09-10 20:00:25 +0000 |
| commit | e4f792588d111b4b4d6044cd241c63e62bcf0d72 (patch) | |
| tree | d824d0312d9c415ac4ef82be797ec2ab7fc76ff7 /src | |
| parent | 1f8653eb229691a34b3470350ff38a8705228129 (diff) | |
| download | emacs-e4f792588d111b4b4d6044cd241c63e62bcf0d72.tar.gz emacs-e4f792588d111b4b4d6044cd241c63e62bcf0d72.zip | |
(x_set_frame_parameters): Make height and width ints.
(Ffocus_frame, Funfocus_frame): Functions deleted.
(x_get_and_record_arg): New function.
(x_icon): Use that, for Qicon_top and Qicon_left.
(x_report_frame_params): Report the Qparent_id parameter.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xfns.c | 90 |
1 files changed, 46 insertions, 44 deletions
diff --git a/src/xfns.c b/src/xfns.c index 3cd23598763..6908d3c4c51 100644 --- a/src/xfns.c +++ b/src/xfns.c | |||
| @@ -724,7 +724,7 @@ x_set_frame_parameters (f, alist) | |||
| 724 | /* If both of these parameters are present, it's more efficient to | 724 | /* If both of these parameters are present, it's more efficient to |
| 725 | set them both at once. So we wait until we've looked at the | 725 | set them both at once. So we wait until we've looked at the |
| 726 | entire list before we set them. */ | 726 | entire list before we set them. */ |
| 727 | Lisp_Object width, height; | 727 | int width, height; |
| 728 | 728 | ||
| 729 | /* Same here. */ | 729 | /* Same here. */ |
| 730 | Lisp_Object left, top; | 730 | Lisp_Object left, top; |
| @@ -759,9 +759,20 @@ x_set_frame_parameters (f, alist) | |||
| 759 | i++; | 759 | i++; |
| 760 | } | 760 | } |
| 761 | 761 | ||
| 762 | width = height = top = left = Qunbound; | 762 | top = left = Qunbound; |
| 763 | icon_left = icon_top = Qunbound; | 763 | icon_left = icon_top = Qunbound; |
| 764 | 764 | ||
| 765 | /* Provide default values for HEIGHT and WIDTH. */ | ||
| 766 | if (FRAME_NEW_WIDTH (f)) | ||
| 767 | width = FRAME_NEW_WIDTH (f); | ||
| 768 | else | ||
| 769 | width = FRAME_WIDTH (f); | ||
| 770 | |||
| 771 | if (FRAME_NEW_HEIGHT (f)) | ||
| 772 | height = FRAME_NEW_HEIGHT (f); | ||
| 773 | else | ||
| 774 | height = FRAME_HEIGHT (f); | ||
| 775 | |||
| 765 | /* Now process them in reverse of specified order. */ | 776 | /* Now process them in reverse of specified order. */ |
| 766 | for (i--; i >= 0; i--) | 777 | for (i--; i >= 0; i--) |
| 767 | { | 778 | { |
| @@ -770,10 +781,10 @@ x_set_frame_parameters (f, alist) | |||
| 770 | prop = parms[i]; | 781 | prop = parms[i]; |
| 771 | val = values[i]; | 782 | val = values[i]; |
| 772 | 783 | ||
| 773 | if (EQ (prop, Qwidth)) | 784 | if (EQ (prop, Qwidth) && NUMBERP (val)) |
| 774 | width = val; | 785 | width = XFASTINT (val); |
| 775 | else if (EQ (prop, Qheight)) | 786 | else if (EQ (prop, Qheight) && NUMBERP (val)) |
| 776 | height = val; | 787 | height = XFASTINT (val); |
| 777 | else if (EQ (prop, Qtop)) | 788 | else if (EQ (prop, Qtop)) |
| 778 | top = val; | 789 | top = val; |
| 779 | else if (EQ (prop, Qleft)) | 790 | else if (EQ (prop, Qleft)) |
| @@ -830,22 +841,6 @@ x_set_frame_parameters (f, alist) | |||
| 830 | XSETINT (icon_top, 0); | 841 | XSETINT (icon_top, 0); |
| 831 | } | 842 | } |
| 832 | 843 | ||
| 833 | /* Don't die if just one of these was set. */ | ||
| 834 | if (EQ (width, Qunbound)) | ||
| 835 | { | ||
| 836 | if (FRAME_NEW_WIDTH (f)) | ||
| 837 | XSETINT (width, FRAME_NEW_WIDTH (f)); | ||
| 838 | else | ||
| 839 | XSETINT (width, FRAME_WIDTH (f)); | ||
| 840 | } | ||
| 841 | if (EQ (height, Qunbound)) | ||
| 842 | { | ||
| 843 | if (FRAME_NEW_HEIGHT (f)) | ||
| 844 | XSETINT (height, FRAME_NEW_HEIGHT (f)); | ||
| 845 | else | ||
| 846 | XSETINT (height, FRAME_HEIGHT (f)); | ||
| 847 | } | ||
| 848 | |||
| 849 | /* Don't set these parameters unless they've been explicitly | 844 | /* Don't set these parameters unless they've been explicitly |
| 850 | specified. The window might be mapped or resized while we're in | 845 | specified. The window might be mapped or resized while we're in |
| 851 | this function, and we don't want to override that unless the lisp | 846 | this function, and we don't want to override that unless the lisp |
| @@ -861,10 +856,10 @@ x_set_frame_parameters (f, alist) | |||
| 861 | 856 | ||
| 862 | XSETFRAME (frame, f); | 857 | XSETFRAME (frame, f); |
| 863 | 858 | ||
| 864 | if ((NUMBERP (width) && XINT (width) != FRAME_WIDTH (f)) | 859 | if (width != FRAME_WIDTH (f) |
| 865 | || (NUMBERP (height) && XINT (height) != FRAME_HEIGHT (f)) | 860 | || height != FRAME_HEIGHT (f) |
| 866 | || FRAME_NEW_HEIGHT (f) || FRAME_NEW_WIDTH (f)) | 861 | || FRAME_NEW_HEIGHT (f) || FRAME_NEW_WIDTH (f)) |
| 867 | Fset_frame_size (frame, width, height); | 862 | Fset_frame_size (frame, make_number (width), make_number (height)); |
| 868 | 863 | ||
| 869 | if ((!NILP (left) || !NILP (top)) | 864 | if ((!NILP (left) || !NILP (top)) |
| 870 | && ! (left_no_change && top_no_change) | 865 | && ! (left_no_change && top_no_change) |
| @@ -1057,6 +1052,10 @@ x_report_frame_params (f, alistptr) | |||
| 1057 | : FRAME_ICONIFIED_P (f) ? Qicon : Qnil)); | 1052 | : FRAME_ICONIFIED_P (f) ? Qicon : Qnil)); |
| 1058 | store_in_alist (alistptr, Qdisplay, | 1053 | store_in_alist (alistptr, Qdisplay, |
| 1059 | XCONS (FRAME_X_DISPLAY_INFO (f)->name_list_element)->car); | 1054 | XCONS (FRAME_X_DISPLAY_INFO (f)->name_list_element)->car); |
| 1055 | |||
| 1056 | store_in_alist (alistptr, Qparent_id, | ||
| 1057 | (f->output_data.x->parent_desc == FRAME_X_DISPLAY_INFO (f)->root_window | ||
| 1058 | ? Qnil : f->output_data.x->parent_desc)); | ||
| 1060 | } | 1059 | } |
| 1061 | 1060 | ||
| 1062 | 1061 | ||
| @@ -2231,6 +2230,25 @@ x_get_arg (alist, param, attribute, class, type) | |||
| 2231 | return Fcdr (tem); | 2230 | return Fcdr (tem); |
| 2232 | } | 2231 | } |
| 2233 | 2232 | ||
| 2233 | /* Like x_get_arg, but also record the value in f->param_alist. */ | ||
| 2234 | |||
| 2235 | static Lisp_Object | ||
| 2236 | x_get_and_record_arg (f, alist, param, attribute, class, type) | ||
| 2237 | struct frame *f; | ||
| 2238 | Lisp_Object alist, param; | ||
| 2239 | char *attribute; | ||
| 2240 | char *class; | ||
| 2241 | enum resource_types type; | ||
| 2242 | { | ||
| 2243 | Lisp_Object value; | ||
| 2244 | |||
| 2245 | value = x_get_arg (alist, param, attribute, class, type); | ||
| 2246 | if (! NILP (value)) | ||
| 2247 | store_frame_param (f, param, value); | ||
| 2248 | |||
| 2249 | return value; | ||
| 2250 | } | ||
| 2251 | |||
| 2234 | /* Record in frame F the specified or default value according to ALIST | 2252 | /* Record in frame F the specified or default value according to ALIST |
| 2235 | of the parameter named PARAM (a Lisp symbol). | 2253 | of the parameter named PARAM (a Lisp symbol). |
| 2236 | If no value is specified for PARAM, look for an X default for XPROP | 2254 | If no value is specified for PARAM, look for an X default for XPROP |
| @@ -2894,8 +2912,8 @@ x_icon (f, parms) | |||
| 2894 | 2912 | ||
| 2895 | /* Set the position of the icon. Note that twm groups all | 2913 | /* Set the position of the icon. Note that twm groups all |
| 2896 | icons in an icon window. */ | 2914 | icons in an icon window. */ |
| 2897 | icon_x = x_get_arg (parms, Qicon_left, 0, 0, number); | 2915 | icon_x = x_get_and_record_arg (f, parms, Qicon_left, 0, 0, number); |
| 2898 | icon_y = x_get_arg (parms, Qicon_top, 0, 0, number); | 2916 | icon_y = x_get_and_record_arg (f, parms, Qicon_top, 0, 0, number); |
| 2899 | if (!EQ (icon_x, Qunbound) && !EQ (icon_y, Qunbound)) | 2917 | if (!EQ (icon_x, Qunbound) && !EQ (icon_y, Qunbound)) |
| 2900 | { | 2918 | { |
| 2901 | CHECK_NUMBER (icon_x, 0); | 2919 | CHECK_NUMBER (icon_x, 0); |
| @@ -3297,6 +3315,7 @@ This function is an internal primitive--use `make-frame' instead.") | |||
| 3297 | /* FRAME is used only to get a handle on the X display. We don't pass the | 3315 | /* FRAME is used only to get a handle on the X display. We don't pass the |
| 3298 | display info directly because we're called from frame.c, which doesn't | 3316 | display info directly because we're called from frame.c, which doesn't |
| 3299 | know about that structure. */ | 3317 | know about that structure. */ |
| 3318 | |||
| 3300 | Lisp_Object | 3319 | Lisp_Object |
| 3301 | x_get_focus_frame (frame) | 3320 | x_get_focus_frame (frame) |
| 3302 | struct frame *frame; | 3321 | struct frame *frame; |
| @@ -3309,21 +3328,6 @@ x_get_focus_frame (frame) | |||
| 3309 | XSETFRAME (xfocus, dpyinfo->x_focus_frame); | 3328 | XSETFRAME (xfocus, dpyinfo->x_focus_frame); |
| 3310 | return xfocus; | 3329 | return xfocus; |
| 3311 | } | 3330 | } |
| 3312 | |||
| 3313 | DEFUN ("focus-frame", Ffocus_frame, Sfocus_frame, 1, 1, 0, | ||
| 3314 | "This function is obsolete, and does nothing.") | ||
| 3315 | (frame) | ||
| 3316 | Lisp_Object frame; | ||
| 3317 | { | ||
| 3318 | return Qnil; | ||
| 3319 | } | ||
| 3320 | |||
| 3321 | DEFUN ("unfocus-frame", Funfocus_frame, Sunfocus_frame, 0, 0, 0, | ||
| 3322 | "This function is obsolete, and does nothing.") | ||
| 3323 | () | ||
| 3324 | { | ||
| 3325 | return Qnil; | ||
| 3326 | } | ||
| 3327 | 3331 | ||
| 3328 | DEFUN ("x-list-fonts", Fx_list_fonts, Sx_list_fonts, 1, 4, 0, | 3332 | DEFUN ("x-list-fonts", Fx_list_fonts, Sx_list_fonts, 1, 4, 0, |
| 3329 | "Return a list of the names of available fonts matching PATTERN.\n\ | 3333 | "Return a list of the names of available fonts matching PATTERN.\n\ |
| @@ -5204,8 +5208,6 @@ unless you set it to something else."); | |||
| 5204 | #endif | 5208 | #endif |
| 5205 | defsubr (&Sx_parse_geometry); | 5209 | defsubr (&Sx_parse_geometry); |
| 5206 | defsubr (&Sx_create_frame); | 5210 | defsubr (&Sx_create_frame); |
| 5207 | defsubr (&Sfocus_frame); | ||
| 5208 | defsubr (&Sunfocus_frame); | ||
| 5209 | #if 0 | 5211 | #if 0 |
| 5210 | defsubr (&Sx_horizontal_line); | 5212 | defsubr (&Sx_horizontal_line); |
| 5211 | #endif | 5213 | #endif |