diff options
| author | Richard M. Stallman | 1994-12-23 05:11:11 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1994-12-23 05:11:11 +0000 |
| commit | a59e4f3d62a637792992f56d9049ab59ccd06dff (patch) | |
| tree | 6b33e66fbc1ab3b75b5ab75e237bdcb1e83e857b /src | |
| parent | af447694e7ceb50ea86e9ea8207e2ae18d1820fa (diff) | |
| download | emacs-a59e4f3d62a637792992f56d9049ab59ccd06dff.tar.gz emacs-a59e4f3d62a637792992f56d9049ab59ccd06dff.zip | |
(x_set_frame_parameters): Handle icon-left, icon-top parms.
(Fx_color_values): Doc fix.
(Fx_create_frame): Check for parent-id parameter.
Set explicit_parent and parent fields.
Don't set visibility if explicit_parent.
[! USE_X_TOOLKIT] (x_window): Specify parent window.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xfns.c | 87 |
1 files changed, 70 insertions, 17 deletions
diff --git a/src/xfns.c b/src/xfns.c index 2c83747eb18..e0b34ec4e2f 100644 --- a/src/xfns.c +++ b/src/xfns.c | |||
| @@ -666,11 +666,15 @@ x_set_frame_parameters (f, alist) | |||
| 666 | /* Same here. */ | 666 | /* Same here. */ |
| 667 | Lisp_Object left, top; | 667 | Lisp_Object left, top; |
| 668 | 668 | ||
| 669 | /* Same with these. */ | ||
| 670 | Lisp_Object icon_left, icon_top; | ||
| 671 | |||
| 669 | /* Record in these vectors all the parms specified. */ | 672 | /* Record in these vectors all the parms specified. */ |
| 670 | Lisp_Object *parms; | 673 | Lisp_Object *parms; |
| 671 | Lisp_Object *values; | 674 | Lisp_Object *values; |
| 672 | int i; | 675 | int i; |
| 673 | int left_no_change = 0, top_no_change = 0; | 676 | int left_no_change = 0, top_no_change = 0; |
| 677 | int icon_left_no_change = 0, icon_top_no_change = 0; | ||
| 674 | 678 | ||
| 675 | i = 0; | 679 | i = 0; |
| 676 | for (tail = alist; CONSP (tail); tail = Fcdr (tail)) | 680 | for (tail = alist; CONSP (tail); tail = Fcdr (tail)) |
| @@ -693,6 +697,7 @@ x_set_frame_parameters (f, alist) | |||
| 693 | } | 697 | } |
| 694 | 698 | ||
| 695 | width = height = top = left = Qunbound; | 699 | width = height = top = left = Qunbound; |
| 700 | icon_left = icon_top = Qunbound; | ||
| 696 | 701 | ||
| 697 | /* Now process them in reverse of specified order. */ | 702 | /* Now process them in reverse of specified order. */ |
| 698 | for (i--; i >= 0; i--) | 703 | for (i--; i >= 0; i--) |
| @@ -710,6 +715,10 @@ x_set_frame_parameters (f, alist) | |||
| 710 | top = val; | 715 | top = val; |
| 711 | else if (EQ (prop, Qleft)) | 716 | else if (EQ (prop, Qleft)) |
| 712 | left = val; | 717 | left = val; |
| 718 | else if (EQ (prop, Qicon_top)) | ||
| 719 | icon_top = val; | ||
| 720 | else if (EQ (prop, Qicon_left)) | ||
| 721 | icon_left = val; | ||
| 713 | else | 722 | else |
| 714 | { | 723 | { |
| 715 | register Lisp_Object param_index, old_value; | 724 | register Lisp_Object param_index, old_value; |
| @@ -742,6 +751,22 @@ x_set_frame_parameters (f, alist) | |||
| 742 | XSETINT (top, f->display.x->top_pos); | 751 | XSETINT (top, f->display.x->top_pos); |
| 743 | } | 752 | } |
| 744 | 753 | ||
| 754 | /* If one of the icon positions was not set, preserve or default it. */ | ||
| 755 | if (EQ (icon_left, Qunbound) || ! INTEGERP (icon_left)) | ||
| 756 | { | ||
| 757 | icon_left_no_change = 1; | ||
| 758 | icon_left = Fcdr (Fassq (Qicon_left, f->param_alist)); | ||
| 759 | if (NILP (icon_left)) | ||
| 760 | XSETINT (icon_left, 0); | ||
| 761 | } | ||
| 762 | if (EQ (icon_top, Qunbound) || ! INTEGERP (icon_top)) | ||
| 763 | { | ||
| 764 | icon_top_no_change = 1; | ||
| 765 | icon_top = Fcdr (Fassq (Qicon_top, f->param_alist)); | ||
| 766 | if (NILP (icon_top)) | ||
| 767 | XSETINT (icon_top, 0); | ||
| 768 | } | ||
| 769 | |||
| 745 | /* Don't die if just one of these was set. */ | 770 | /* Don't die if just one of these was set. */ |
| 746 | if (EQ (width, Qunbound)) | 771 | if (EQ (width, Qunbound)) |
| 747 | XSETINT (width, FRAME_WIDTH (f)); | 772 | XSETINT (width, FRAME_WIDTH (f)); |
| @@ -831,6 +856,10 @@ x_set_frame_parameters (f, alist) | |||
| 831 | /* Actually set that position, and convert to absolute. */ | 856 | /* Actually set that position, and convert to absolute. */ |
| 832 | x_set_offset (f, leftpos, toppos, 0); | 857 | x_set_offset (f, leftpos, toppos, 0); |
| 833 | } | 858 | } |
| 859 | |||
| 860 | if ((!NILP (icon_left) || !NILP (icon_top)) | ||
| 861 | && ! (icon_left_no_change && icon_top_no_change)) | ||
| 862 | x_wm_set_icon_position (f, XINT (icon_left), XINT (icon_top)); | ||
| 834 | } | 863 | } |
| 835 | } | 864 | } |
| 836 | 865 | ||
| @@ -1819,7 +1848,7 @@ enum resource_types | |||
| 1819 | 1848 | ||
| 1820 | If no default is specified, return Qunbound. If you call | 1849 | If no default is specified, return Qunbound. If you call |
| 1821 | x_get_arg, make sure you deal with Qunbound in a reasonable way, | 1850 | x_get_arg, make sure you deal with Qunbound in a reasonable way, |
| 1822 | and don't let it get stored in any lisp-visible variables! */ | 1851 | and don't let it get stored in any Lisp-visible variables! */ |
| 1823 | 1852 | ||
| 1824 | static Lisp_Object | 1853 | static Lisp_Object |
| 1825 | x_get_arg (alist, param, attribute, class, type) | 1854 | x_get_arg (alist, param, attribute, class, type) |
| @@ -2382,7 +2411,7 @@ x_window (f) | |||
| 2382 | BLOCK_INPUT; | 2411 | BLOCK_INPUT; |
| 2383 | FRAME_X_WINDOW (f) | 2412 | FRAME_X_WINDOW (f) |
| 2384 | = XCreateWindow (FRAME_X_DISPLAY (f), | 2413 | = XCreateWindow (FRAME_X_DISPLAY (f), |
| 2385 | FRAME_X_DISPLAY_INFO (f)->root_window, | 2414 | f->display.x->parent_desc, |
| 2386 | f->display.x->left_pos, | 2415 | f->display.x->left_pos, |
| 2387 | f->display.x->top_pos, | 2416 | f->display.x->top_pos, |
| 2388 | PIXEL_WIDTH (f), PIXEL_HEIGHT (f), | 2417 | PIXEL_WIDTH (f), PIXEL_HEIGHT (f), |
| @@ -2575,6 +2604,7 @@ This function is an internal primitive--use `make-frame' instead.") | |||
| 2575 | struct gcpro gcpro1; | 2604 | struct gcpro gcpro1; |
| 2576 | Lisp_Object display; | 2605 | Lisp_Object display; |
| 2577 | struct x_display_info *dpyinfo; | 2606 | struct x_display_info *dpyinfo; |
| 2607 | Lisp_Object parent; | ||
| 2578 | 2608 | ||
| 2579 | check_x (); | 2609 | check_x (); |
| 2580 | 2610 | ||
| @@ -2589,6 +2619,13 @@ This function is an internal primitive--use `make-frame' instead.") | |||
| 2589 | && ! NILP (name)) | 2619 | && ! NILP (name)) |
| 2590 | error ("Invalid frame name--not a string or nil"); | 2620 | error ("Invalid frame name--not a string or nil"); |
| 2591 | 2621 | ||
| 2622 | /* See if parent window is specified. */ | ||
| 2623 | parent = x_get_arg (parms, Qparent_id, NULL, NULL, number); | ||
| 2624 | if (EQ (parent, Qunbound)) | ||
| 2625 | parent = Qnil; | ||
| 2626 | if (! NILP (parent)) | ||
| 2627 | CHECK_NUMBER (parent, 0); | ||
| 2628 | |||
| 2592 | tem = x_get_arg (parms, Qminibuffer, 0, 0, symbol); | 2629 | tem = x_get_arg (parms, Qminibuffer, 0, 0, symbol); |
| 2593 | if (EQ (tem, Qnone) || NILP (tem)) | 2630 | if (EQ (tem, Qnone) || NILP (tem)) |
| 2594 | f = make_frame_without_minibuffer (Qnil); | 2631 | f = make_frame_without_minibuffer (Qnil); |
| @@ -2615,6 +2652,19 @@ This function is an internal primitive--use `make-frame' instead.") | |||
| 2615 | 2652 | ||
| 2616 | FRAME_X_DISPLAY_INFO (f) = dpyinfo; | 2653 | FRAME_X_DISPLAY_INFO (f) = dpyinfo; |
| 2617 | 2654 | ||
| 2655 | /* Specify the parent under which to make this X window. */ | ||
| 2656 | |||
| 2657 | if (!NILP (parent)) | ||
| 2658 | { | ||
| 2659 | f->display.x->parent_desc = parent; | ||
| 2660 | f->display.x->explicit_parent = 1; | ||
| 2661 | } | ||
| 2662 | else | ||
| 2663 | { | ||
| 2664 | f->display.x->parent_desc = FRAME_X_DISPLAY_INFO (f)->root_window; | ||
| 2665 | f->display.x->explicit_parent = 0; | ||
| 2666 | } | ||
| 2667 | |||
| 2618 | /* Note that the frame has no physical cursor right now. */ | 2668 | /* Note that the frame has no physical cursor right now. */ |
| 2619 | f->phys_cursor_x = -1; | 2669 | f->phys_cursor_x = -1; |
| 2620 | 2670 | ||
| @@ -2778,22 +2828,24 @@ This function is an internal primitive--use `make-frame' instead.") | |||
| 2778 | FRAME_X_DISPLAY_INFO (f)->reference_count++; | 2828 | FRAME_X_DISPLAY_INFO (f)->reference_count++; |
| 2779 | 2829 | ||
| 2780 | /* Make the window appear on the frame and enable display, | 2830 | /* Make the window appear on the frame and enable display, |
| 2781 | unless the caller says not to. */ | 2831 | unless the caller says not to. However, with explicit parent, |
| 2782 | { | 2832 | Emacs cannot control visibility, so don't try. */ |
| 2783 | Lisp_Object visibility; | 2833 | if (! f->display.x->explicit_parent) |
| 2834 | { | ||
| 2835 | Lisp_Object visibility; | ||
| 2784 | 2836 | ||
| 2785 | visibility = x_get_arg (parms, Qvisibility, 0, 0, symbol); | 2837 | visibility = x_get_arg (parms, Qvisibility, 0, 0, symbol); |
| 2786 | if (EQ (visibility, Qunbound)) | 2838 | if (EQ (visibility, Qunbound)) |
| 2787 | visibility = Qt; | 2839 | visibility = Qt; |
| 2788 | 2840 | ||
| 2789 | if (EQ (visibility, Qicon)) | 2841 | if (EQ (visibility, Qicon)) |
| 2790 | x_iconify_frame (f); | 2842 | x_iconify_frame (f); |
| 2791 | else if (! NILP (visibility)) | 2843 | else if (! NILP (visibility)) |
| 2792 | x_make_frame_visible (f); | 2844 | x_make_frame_visible (f); |
| 2793 | else | 2845 | else |
| 2794 | /* Must have been Qnil. */ | 2846 | /* Must have been Qnil. */ |
| 2795 | ; | 2847 | ; |
| 2796 | } | 2848 | } |
| 2797 | 2849 | ||
| 2798 | return unbind_to (count, frame); | 2850 | return unbind_to (count, frame); |
| 2799 | } | 2851 | } |
| @@ -3034,7 +3086,8 @@ If FRAME is omitted or nil, use the selected frame.") | |||
| 3034 | DEFUN ("x-color-values", Fx_color_values, Sx_color_values, 1, 2, 0, | 3086 | DEFUN ("x-color-values", Fx_color_values, Sx_color_values, 1, 2, 0, |
| 3035 | "Return a description of the color named COLOR on frame FRAME.\n\ | 3087 | "Return a description of the color named COLOR on frame FRAME.\n\ |
| 3036 | The value is a list of integer RGB values--(RED GREEN BLUE).\n\ | 3088 | The value is a list of integer RGB values--(RED GREEN BLUE).\n\ |
| 3037 | These values appear to range from 0 to 65280; white is (65280 65280 65280).\n\ | 3089 | These values appear to range from 0 to 65280 or 65535, depending\n\ |
| 3090 | on the system; white is (65280 65280 65280) or (65535 65535 65535).\n\ | ||
| 3038 | If FRAME is omitted or nil, use the selected frame.") | 3091 | If FRAME is omitted or nil, use the selected frame.") |
| 3039 | (color, frame) | 3092 | (color, frame) |
| 3040 | Lisp_Object color, frame; | 3093 | Lisp_Object color, frame; |