comparison src/xfns.c @ 2294:9bce20507666

Use the `visiblity' parameter to determine the initial state of the frame, instead of the `iconic-startup' and `suppress-initial-map'. * xfns.c (x_icon): Test the Qvisibility parameter against Qicon, instead of the Qiconic_startup against Qt. (x_create_frame): Test Qvisibility against Qnil and Qicon, instead of testing Qsuppress_initial_map and Qvisibility. (Qicon): New symbol. (Qiconic_startup, Qsuppress_icon, Qsuppress_initial_map): Removed. (syms_of_xfns): Adjusted appropriately. * xfns.c [not HAVE_X11] (x_create_frame): Check Qicon_type, instead of Qsuppress_icon. * xfns.c (x_set_visibility): Instead of interpreting only Qt as `make the frame visible' and everything else as `iconify the frame', interpret Qicon as `iconify the frame' and everything else as `make the frame visible.' * xfns.c (x_get_arg): When the type of the resource is `symbol', return `true' and `on' as Qt, and `false' and `off' as Qnil.
author Jim Blandy <jimb@redhat.com>
date Sun, 21 Mar 1993 05:11:23 +0000
parents 997f8e481bf8
children 0d8ce1b8ceee
comparison
equal deleted inserted replaced
2293:6c5e38aeb94b 2294:9bce20507666
159 Lisp_Object Qcursor_color; 159 Lisp_Object Qcursor_color;
160 Lisp_Object Qcursor_type; 160 Lisp_Object Qcursor_type;
161 Lisp_Object Qfont; 161 Lisp_Object Qfont;
162 Lisp_Object Qforeground_color; 162 Lisp_Object Qforeground_color;
163 Lisp_Object Qgeometry; 163 Lisp_Object Qgeometry;
164 Lisp_Object Qicon;
164 Lisp_Object Qicon_left; 165 Lisp_Object Qicon_left;
165 Lisp_Object Qicon_top; 166 Lisp_Object Qicon_top;
166 Lisp_Object Qicon_type; 167 Lisp_Object Qicon_type;
167 Lisp_Object Qiconic_startup;
168 Lisp_Object Qinternal_border_width; 168 Lisp_Object Qinternal_border_width;
169 Lisp_Object Qleft; 169 Lisp_Object Qleft;
170 Lisp_Object Qmouse_color; 170 Lisp_Object Qmouse_color;
171 Lisp_Object Qnone; 171 Lisp_Object Qnone;
172 Lisp_Object Qparent_id; 172 Lisp_Object Qparent_id;
173 Lisp_Object Qsuppress_icon;
174 Lisp_Object Qsuppress_initial_map;
175 Lisp_Object Qtop; 173 Lisp_Object Qtop;
176 Lisp_Object Qundefined_color; 174 Lisp_Object Qundefined_color;
177 Lisp_Object Qvertical_scroll_bars; 175 Lisp_Object Qvertical_scroll_bars;
176 Lisp_Object Qvisibility;
178 Lisp_Object Qwindow_id; 177 Lisp_Object Qwindow_id;
179 Lisp_Object Qx_frame_parameter; 178 Lisp_Object Qx_frame_parameter;
180 Lisp_Object Qvisibility;
181 179
182 /* The below are defined in frame.c. */ 180 /* The below are defined in frame.c. */
183 extern Lisp_Object Qheight, Qminibuffer, Qname, Qonly, Qwidth; 181 extern Lisp_Object Qheight, Qminibuffer, Qname, Qonly, Qwidth;
184 extern Lisp_Object Qunsplittable, Qmenu_bar_lines, Qicon; 182 extern Lisp_Object Qunsplittable, Qmenu_bar_lines, Qicon;
185 183
855 Lisp_Object frame; 853 Lisp_Object frame;
856 XSET (frame, Lisp_Frame, f); 854 XSET (frame, Lisp_Frame, f);
857 855
858 if (NILP (value)) 856 if (NILP (value))
859 Fmake_frame_invisible (frame); 857 Fmake_frame_invisible (frame);
860 else if (EQ (value, Qt)) 858 else if (EQ (value, Qicon))
859 Ficonify_frame (frame);
860 else
861 Fmake_frame_visible (frame); 861 Fmake_frame_visible (frame);
862 else
863 Ficonify_frame (frame);
864 } 862 }
865 863
866 static void 864 static void
867 x_set_menu_bar_lines_1 (window, n) 865 x_set_menu_bar_lines_1 (window, n)
868 Lisp_Object window; 866 Lisp_Object window;
1427 1425
1428 case string: 1426 case string:
1429 return tem; 1427 return tem;
1430 1428
1431 case symbol: 1429 case symbol:
1432 return intern (tem); 1430 /* As a special case, we map the values `true' and `on'
1431 to Qt, and `false' and `off' to Qnil. */
1432 {
1433 Lisp_Object lower = Fdowncase (tem);
1434 if (!strcmp (XSTRING (tem)->data, "on")
1435 || !strcmp (XSTRING (tem)->data, "true"))
1436 return Qt;
1437 else (!strcmp (XSTRING (tem)->data, "off")
1438 || !strcmp (XSTRING (tem)->data, "false"))
1439 return Qnil;
1440 else
1441 return intern (tem);
1442 }
1433 1443
1434 default: 1444 default:
1435 abort (); 1445 abort ();
1436 } 1446 }
1437 } 1447 }
1701 1711
1702 if (! EQ (icon_x, Qunbound)) 1712 if (! EQ (icon_x, Qunbound))
1703 x_wm_set_icon_position (f, XINT (icon_x), XINT (icon_y)); 1713 x_wm_set_icon_position (f, XINT (icon_x), XINT (icon_y));
1704 1714
1705 /* Start up iconic or window? */ 1715 /* Start up iconic or window? */
1706 x_wm_set_window_state (f, 1716 x_wm_set_window_state
1707 (EQ (x_get_arg (parms, Qiconic_startup, 1717 (f, (EQ (x_get_arg (parms, Qvisibility, 0, 0, symbol), Qicon)
1708 0, 0, boolean), 1718 ? IconicState
1709 Qt) 1719 : NormalState));
1710 ? IconicState
1711 : NormalState));
1712 1720
1713 UNBLOCK_INPUT; 1721 UNBLOCK_INPUT;
1714 } 1722 }
1715 1723
1716 /* Make the GC's needed for this window, setting the 1724 /* Make the GC's needed for this window, setting the
1909 tem = x_get_arg (parms, Qunsplittable, 0, 0, boolean); 1917 tem = x_get_arg (parms, Qunsplittable, 0, 0, boolean);
1910 f->no_split = minibuffer_only || EQ (tem, Qt); 1918 f->no_split = minibuffer_only || EQ (tem, Qt);
1911 1919
1912 /* Make the window appear on the frame and enable display, 1920 /* Make the window appear on the frame and enable display,
1913 unless the caller says not to. */ 1921 unless the caller says not to. */
1914 if (!EQ (x_get_arg (parms, Qsuppress_initial_map, 0, 0, boolean), Qt)) 1922 {
1915 { 1923 Lisp_Object visibility = x_get_arg (parms, Qvisibility, 0, 0, symbol);
1916 tem = x_get_arg (parms, Qvisibility, 0, 0, boolean); 1924
1917 if (EQ (tem, Qicon)) 1925 if (EQ (visibility, Qunbound))
1918 x_iconify_frame (f); 1926 visibility = Qt;
1919 /* Note that the default is Qunbound, 1927
1920 so by default we do make visible. */ 1928 if (EQ (visibility, Qicon))
1921 else if (!EQ (tem, Qnil)) 1929 x_iconify_frame (f);
1922 x_make_frame_visible (f); 1930 else if (! NILP (visibility))
1923 } 1931 x_make_frame_visible (f);
1932 else
1933 /* Must have been Qnil. */
1934 ;
1935 }
1924 1936
1925 return frame; 1937 return frame;
1926 #else /* X10 */ 1938 #else /* X10 */
1927 struct frame *f; 1939 struct frame *f;
1928 Lisp_Object frame, tem; 1940 Lisp_Object frame, tem;
2120 /* Now override the defaults with all the rest of the specified 2132 /* Now override the defaults with all the rest of the specified
2121 parms. */ 2133 parms. */
2122 tem = x_get_arg (parms, Qunsplittable, 0, 0, boolean); 2134 tem = x_get_arg (parms, Qunsplittable, 0, 0, boolean);
2123 f->no_split = minibuffer_only || EQ (tem, Qt); 2135 f->no_split = minibuffer_only || EQ (tem, Qt);
2124 2136
2125 /* Do not create an icon window if the caller says not to */ 2137 /* Do not create an icon window if the caller says not to.
2126 if (!EQ (x_get_arg (parms, Qsuppress_icon, 0, 0, boolean), Qt) 2138 I'm not sure that this code is right; how does X10 handle icons? */
2127 || f->display.x->parent_desc != ROOT_WINDOW) 2139 x_text_icon (f, iconidentity);
2128 { 2140 x_default_parameter (f, parms, Qicon_type, Qnil,
2129 x_text_icon (f, iconidentity); 2141 "BitmapIcon", 0, symbol);
2130 x_default_parameter (f, parms, Qicon_type, Qnil,
2131 "BitmapIcon", 0, symbol);
2132 }
2133 2142
2134 /* Tell the X server the previously set values of the 2143 /* Tell the X server the previously set values of the
2135 background, border and mouse colors; also create the mouse cursor. */ 2144 background, border and mouse colors; also create the mouse cursor. */
2136 BLOCK_INPUT; 2145 BLOCK_INPUT;
2137 temp = XMakeTile (f->display.x->background_pixel); 2146 temp = XMakeTile (f->display.x->background_pixel);
2145 /* Now override the defaults with all the rest of the specified parms. */ 2154 /* Now override the defaults with all the rest of the specified parms. */
2146 2155
2147 Fmodify_frame_parameters (frame, parms); 2156 Fmodify_frame_parameters (frame, parms);
2148 2157
2149 /* Make the window appear on the frame and enable display. */ 2158 /* Make the window appear on the frame and enable display. */
2150 2159 {
2151 if (!EQ (x_get_arg (parms, Qsuppress_initial_map, 0, 0, boolean), Qt)) 2160 Lisp_Object visibility = x_get_arg (parms, Qvisibility, 0, 0, symbol);
2152 x_make_window_visible (f); 2161
2162 if (EQ (visibility, Qunbound))
2163 visibility = Qt;
2164
2165 if (! EQ (visibility, Qicon)
2166 && ! NILP (visibility))
2167 x_make_window_visible (f);
2168 }
2169
2153 SET_FRAME_GARBAGED (f); 2170 SET_FRAME_GARBAGED (f);
2154 2171
2155 return frame; 2172 return frame;
2156 #endif /* X10 */ 2173 #endif /* X10 */
2157 } 2174 }
3859 staticpro (&Qfont); 3876 staticpro (&Qfont);
3860 Qforeground_color = intern ("foreground-color"); 3877 Qforeground_color = intern ("foreground-color");
3861 staticpro (&Qforeground_color); 3878 staticpro (&Qforeground_color);
3862 Qgeometry = intern ("geometry"); 3879 Qgeometry = intern ("geometry");
3863 staticpro (&Qgeometry); 3880 staticpro (&Qgeometry);
3881 Qicon = intern ("icon");
3882 staticpro (&Qicon);
3864 Qicon_left = intern ("icon-left"); 3883 Qicon_left = intern ("icon-left");
3865 staticpro (&Qicon_left); 3884 staticpro (&Qicon_left);
3866 Qicon_top = intern ("icon-top"); 3885 Qicon_top = intern ("icon-top");
3867 staticpro (&Qicon_top); 3886 staticpro (&Qicon_top);
3868 Qicon_type = intern ("icon-type"); 3887 Qicon_type = intern ("icon-type");
3869 staticpro (&Qicon_type); 3888 staticpro (&Qicon_type);
3870 Qiconic_startup = intern ("iconic-startup");
3871 staticpro (&Qiconic_startup);
3872 Qinternal_border_width = intern ("internal-border-width"); 3889 Qinternal_border_width = intern ("internal-border-width");
3873 staticpro (&Qinternal_border_width); 3890 staticpro (&Qinternal_border_width);
3874 Qleft = intern ("left"); 3891 Qleft = intern ("left");
3875 staticpro (&Qleft); 3892 staticpro (&Qleft);
3876 Qmouse_color = intern ("mouse-color"); 3893 Qmouse_color = intern ("mouse-color");
3877 staticpro (&Qmouse_color); 3894 staticpro (&Qmouse_color);
3878 Qnone = intern ("none"); 3895 Qnone = intern ("none");
3879 staticpro (&Qnone); 3896 staticpro (&Qnone);
3880 Qparent_id = intern ("parent-id"); 3897 Qparent_id = intern ("parent-id");
3881 staticpro (&Qparent_id); 3898 staticpro (&Qparent_id);
3882 Qsuppress_icon = intern ("suppress-icon");
3883 staticpro (&Qsuppress_icon);
3884 Qsuppress_initial_map = intern ("suppress-initial-map");
3885 staticpro (&Qsuppress_initial_map);
3886 Qtop = intern ("top"); 3899 Qtop = intern ("top");
3887 staticpro (&Qtop); 3900 staticpro (&Qtop);
3888 Qundefined_color = intern ("undefined-color"); 3901 Qundefined_color = intern ("undefined-color");
3889 staticpro (&Qundefined_color); 3902 staticpro (&Qundefined_color);
3890 Qvertical_scroll_bars = intern ("vertical-scroll-bars"); 3903 Qvertical_scroll_bars = intern ("vertical-scroll-bars");
3891 staticpro (&Qvertical_scroll_bars); 3904 staticpro (&Qvertical_scroll_bars);
3905 Qvisibility = intern ("visibility");
3906 staticpro (&Qvisibility);
3892 Qwindow_id = intern ("window-id"); 3907 Qwindow_id = intern ("window-id");
3893 staticpro (&Qwindow_id); 3908 staticpro (&Qwindow_id);
3894 Qx_frame_parameter = intern ("x-frame-parameter"); 3909 Qx_frame_parameter = intern ("x-frame-parameter");
3895 staticpro (&Qx_frame_parameter); 3910 staticpro (&Qx_frame_parameter);
3896 /* This is the end of symbol initialization. */ 3911 /* This is the end of symbol initialization. */
3897 Qvisibility = intern ("visibility");
3898 staticpro (&Qvisibility);
3899 3912
3900 Fput (Qundefined_color, Qerror_conditions, 3913 Fput (Qundefined_color, Qerror_conditions,
3901 Fcons (Qundefined_color, Fcons (Qerror, Qnil))); 3914 Fcons (Qundefined_color, Fcons (Qerror, Qnil)));
3902 Fput (Qundefined_color, Qerror_message, 3915 Fput (Qundefined_color, Qerror_message,
3903 build_string ("Undefined color")); 3916 build_string ("Undefined color"));