diff options
| author | Richard M. Stallman | 1993-03-11 08:10:58 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1993-03-11 08:10:58 +0000 |
| commit | d043f1a41bb43bde4b86c192eb53bbebb5d8da8e (patch) | |
| tree | 57af6f93f0536bae27a014d9124b134191da7edf /src | |
| parent | d9dcaf49d9b457bd184ae3d37da9e99d25bfb528 (diff) | |
| download | emacs-d043f1a41bb43bde4b86c192eb53bbebb5d8da8e.tar.gz emacs-d043f1a41bb43bde4b86c192eb53bbebb5d8da8e.zip | |
(x_frame_parms): Add elts for visibility and menu-bar-lines.
(enum x_frame_parm): Likewise.
(x_set_menu_bar_lines, x_set_menu_bar_lines_1): New functions.
(x_set_visibility): New function.
(Fx_create_frame): Handle menu-bar-lines parm.
(x_report_frame_params): Report Qvisibility.
(syms_of_xfns): Set up Qvisibility.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xfns.c | 125 |
1 files changed, 91 insertions, 34 deletions
diff --git a/src/xfns.c b/src/xfns.c index 307aa35f0b0..f4632b40987 100644 --- a/src/xfns.c +++ b/src/xfns.c | |||
| @@ -248,10 +248,11 @@ Lisp_Object Qundefined_color; | |||
| 248 | Lisp_Object Qvertical_scroll_bars; | 248 | Lisp_Object Qvertical_scroll_bars; |
| 249 | Lisp_Object Qwindow_id; | 249 | Lisp_Object Qwindow_id; |
| 250 | Lisp_Object Qx_frame_parameter; | 250 | Lisp_Object Qx_frame_parameter; |
| 251 | Lisp_Object Qvisibility; | ||
| 251 | 252 | ||
| 252 | /* The below are defined in frame.c. */ | 253 | /* The below are defined in frame.c. */ |
| 253 | extern Lisp_Object Qheight, Qminibuffer, Qname, Qonly, Qwidth; | 254 | extern Lisp_Object Qheight, Qminibuffer, Qname, Qonly, Qwidth; |
| 254 | extern Lisp_Object Qunsplittable; | 255 | extern Lisp_Object Qunsplittable, Qmenu_bar_lines, Qicon; |
| 255 | 256 | ||
| 256 | extern Lisp_Object Vwindow_system_version; | 257 | extern Lisp_Object Vwindow_system_version; |
| 257 | 258 | ||
| @@ -307,6 +308,8 @@ enum x_frame_parm | |||
| 307 | X_PARM_AUTORAISE, | 308 | X_PARM_AUTORAISE, |
| 308 | X_PARM_AUTOLOWER, | 309 | X_PARM_AUTOLOWER, |
| 309 | X_PARM_VERT_SCROLL_BAR, | 310 | X_PARM_VERT_SCROLL_BAR, |
| 311 | X_PARM_VISIBILITY, | ||
| 312 | X_PARM_MENU_BAR_LINES | ||
| 310 | }; | 313 | }; |
| 311 | 314 | ||
| 312 | 315 | ||
| @@ -330,6 +333,8 @@ void x_explicitly_set_name (); | |||
| 330 | void x_set_autoraise (); | 333 | void x_set_autoraise (); |
| 331 | void x_set_autolower (); | 334 | void x_set_autolower (); |
| 332 | void x_set_vertical_scroll_bars (); | 335 | void x_set_vertical_scroll_bars (); |
| 336 | void x_set_visibility (); | ||
| 337 | void x_set_menu_bar_lines (); | ||
| 333 | 338 | ||
| 334 | static struct x_frame_parm_table x_frame_parms[] = | 339 | static struct x_frame_parm_table x_frame_parms[] = |
| 335 | { | 340 | { |
| @@ -347,6 +352,8 @@ static struct x_frame_parm_table x_frame_parms[] = | |||
| 347 | "auto-raise", x_set_autoraise, | 352 | "auto-raise", x_set_autoraise, |
| 348 | "auto-lower", x_set_autolower, | 353 | "auto-lower", x_set_autolower, |
| 349 | "vertical-scroll-bars", x_set_vertical_scroll_bars, | 354 | "vertical-scroll-bars", x_set_vertical_scroll_bars, |
| 355 | "visibility", x_set_visibility, | ||
| 356 | "menu-bar-lines", x_set_menu_bar_lines, | ||
| 350 | }; | 357 | }; |
| 351 | 358 | ||
| 352 | /* Attach the `x-frame-parameter' properties to | 359 | /* Attach the `x-frame-parameter' properties to |
| @@ -356,15 +363,15 @@ init_x_parm_symbols () | |||
| 356 | { | 363 | { |
| 357 | int i; | 364 | int i; |
| 358 | 365 | ||
| 359 | for (i = 0; i < sizeof (x_frame_parms)/sizeof (x_frame_parms[0]); i++) | 366 | for (i = 0; i < sizeof (x_frame_parms) / sizeof (x_frame_parms[0]); i++) |
| 360 | Fput (intern (x_frame_parms[i].name), Qx_frame_parameter, | 367 | Fput (intern (x_frame_parms[i].name), Qx_frame_parameter, |
| 361 | make_number (i)); | 368 | make_number (i)); |
| 362 | } | 369 | } |
| 363 | 370 | ||
| 364 | #if 1 | ||
| 365 | /* Change the parameters of FRAME as specified by ALIST. | 371 | /* Change the parameters of FRAME as specified by ALIST. |
| 366 | If a parameter is not specially recognized, do nothing; | 372 | If a parameter is not specially recognized, do nothing; |
| 367 | otherwise call the `x_set_...' function for that parameter. */ | 373 | otherwise call the `x_set_...' function for that parameter. */ |
| 374 | |||
| 368 | void | 375 | void |
| 369 | x_set_frame_parameters (f, alist) | 376 | x_set_frame_parameters (f, alist) |
| 370 | FRAME_PTR f; | 377 | FRAME_PTR f; |
| @@ -429,29 +436,7 @@ x_set_frame_parameters (f, alist) | |||
| 429 | Fset_frame_position (frame, left, top); | 436 | Fset_frame_position (frame, left, top); |
| 430 | } | 437 | } |
| 431 | } | 438 | } |
| 432 | #else | ||
| 433 | /* Report to X that a frame parameter of frame F is being set or changed. | ||
| 434 | PARAM is the symbol that says which parameter. | ||
| 435 | VAL is the new value. | ||
| 436 | OLDVAL is the old value. | ||
| 437 | If the parameter is not specially recognized, do nothing; | ||
| 438 | otherwise the `x_set_...' function for this parameter. */ | ||
| 439 | 439 | ||
| 440 | void | ||
| 441 | x_set_frame_param (f, param, val, oldval) | ||
| 442 | register struct frame *f; | ||
| 443 | Lisp_Object param; | ||
| 444 | register Lisp_Object val; | ||
| 445 | register Lisp_Object oldval; | ||
| 446 | { | ||
| 447 | register Lisp_Object tem; | ||
| 448 | tem = Fget (param, Qx_frame_parameter); | ||
| 449 | if (XTYPE (tem) == Lisp_Int | ||
| 450 | && XINT (tem) >= 0 | ||
| 451 | && XINT (tem) < sizeof (x_frame_parms)/sizeof (x_frame_parms[0])) | ||
| 452 | (*x_frame_parms[XINT (tem)].setter)(f, val, oldval); | ||
| 453 | } | ||
| 454 | #endif | ||
| 455 | /* Insert a description of internally-recorded parameters of frame X | 440 | /* Insert a description of internally-recorded parameters of frame X |
| 456 | into the parameter alist *ALISTPTR that is to be given to the user. | 441 | into the parameter alist *ALISTPTR that is to be given to the user. |
| 457 | Only parameters that are specific to the X window system | 442 | Only parameters that are specific to the X window system |
| @@ -473,6 +458,9 @@ x_report_frame_params (f, alistptr) | |||
| 473 | sprintf (buf, "%d", FRAME_X_WINDOW (f)); | 458 | sprintf (buf, "%d", FRAME_X_WINDOW (f)); |
| 474 | store_in_alist (alistptr, Qwindow_id, | 459 | store_in_alist (alistptr, Qwindow_id, |
| 475 | build_string (buf)); | 460 | build_string (buf)); |
| 461 | store_in_alist (alistptr, Qvisibility, | ||
| 462 | (FRAME_VISIBLE_P (f) ? Qt | ||
| 463 | : FRAME_ICONIFIED_P (f) ? Qicon : Qnil)); | ||
| 476 | } | 464 | } |
| 477 | 465 | ||
| 478 | /* Decide if color named COLOR is valid for the display | 466 | /* Decide if color named COLOR is valid for the display |
| @@ -930,6 +918,60 @@ x_set_internal_border_width (f, arg, oldval) | |||
| 930 | } | 918 | } |
| 931 | } | 919 | } |
| 932 | 920 | ||
| 921 | void | ||
| 922 | x_set_visibility (f, value, oldval) | ||
| 923 | struct frame *f; | ||
| 924 | Lisp_Object value, oldval; | ||
| 925 | { | ||
| 926 | Lisp_Object frame; | ||
| 927 | XSET (frame, Lisp_Frame, f); | ||
| 928 | |||
| 929 | if (NILP (value)) | ||
| 930 | Fmake_frame_invisible (frame); | ||
| 931 | else if (EQ (value, Qt)) | ||
| 932 | Fmake_frame_visible (frame); | ||
| 933 | else | ||
| 934 | Ficonify_frame (frame); | ||
| 935 | } | ||
| 936 | |||
| 937 | static void | ||
| 938 | x_set_menu_bar_lines_1 (window, n) | ||
| 939 | Lisp_Object window; | ||
| 940 | int n; | ||
| 941 | { | ||
| 942 | for (; !NILP (window); window = XWINDOW (window)->next) | ||
| 943 | { | ||
| 944 | struct window *w = XWINDOW (window); | ||
| 945 | |||
| 946 | w->top += n; | ||
| 947 | |||
| 948 | if (!NILP (w->vchild)) | ||
| 949 | x_set_menu_bar_lines_1 (w->vchild); | ||
| 950 | |||
| 951 | if (!NILP (w->hchild)) | ||
| 952 | x_set_menu_bar_lines_1 (w->hchild); | ||
| 953 | } | ||
| 954 | } | ||
| 955 | |||
| 956 | void | ||
| 957 | x_set_menu_bar_lines (f, value, oldval) | ||
| 958 | struct frame *f; | ||
| 959 | Lisp_Object value, oldval; | ||
| 960 | { | ||
| 961 | int nlines; | ||
| 962 | int olines = FRAME_MENU_BAR_LINES (f); | ||
| 963 | |||
| 964 | if (XTYPE (value) == Lisp_Int) | ||
| 965 | nlines = XINT (value); | ||
| 966 | else | ||
| 967 | nlines = 0; | ||
| 968 | |||
| 969 | FRAME_MENU_BAR_LINES (f) = nlines; | ||
| 970 | x_set_menu_bar_lines_1 (f->root_window, nlines - olines); | ||
| 971 | x_set_window_size (f, FRAME_WIDTH (f), | ||
| 972 | FRAME_HEIGHT (f) + nlines - olines); | ||
| 973 | } | ||
| 974 | |||
| 933 | /* Change the name of frame F to ARG. If ARG is nil, set F's name to | 975 | /* Change the name of frame F to ARG. If ARG is nil, set F's name to |
| 934 | x_id_name. | 976 | x_id_name. |
| 935 | 977 | ||
| @@ -1801,13 +1843,13 @@ x_make_gc (f) | |||
| 1801 | /* Create the gray border tile used when the pointer is not in | 1843 | /* Create the gray border tile used when the pointer is not in |
| 1802 | the frame. Since this depends on the frame's pixel values, | 1844 | the frame. Since this depends on the frame's pixel values, |
| 1803 | this must be done on a per-frame basis. */ | 1845 | this must be done on a per-frame basis. */ |
| 1804 | f->display.x->border_tile = | 1846 | f->display.x->border_tile |
| 1805 | XCreatePixmapFromBitmapData | 1847 | = (XCreatePixmapFromBitmapData |
| 1806 | (x_current_display, ROOT_WINDOW, | 1848 | (x_current_display, ROOT_WINDOW, |
| 1807 | gray_bits, gray_width, gray_height, | 1849 | gray_bits, gray_width, gray_height, |
| 1808 | f->display.x->foreground_pixel, | 1850 | f->display.x->foreground_pixel, |
| 1809 | f->display.x->background_pixel, | 1851 | f->display.x->background_pixel, |
| 1810 | DefaultDepth (x_current_display, XDefaultScreen (x_current_display))); | 1852 | DefaultDepth (x_current_display, XDefaultScreen (x_current_display)))); |
| 1811 | } | 1853 | } |
| 1812 | #endif /* HAVE_X11 */ | 1854 | #endif /* HAVE_X11 */ |
| 1813 | 1855 | ||
| @@ -1927,6 +1969,10 @@ be shared by the new frame.") | |||
| 1927 | height = f->height; | 1969 | height = f->height; |
| 1928 | f->height = f->width = 0; | 1970 | f->height = f->width = 0; |
| 1929 | change_frame_size (f, height, width, 1, 0); | 1971 | change_frame_size (f, height, width, 1, 0); |
| 1972 | |||
| 1973 | x_default_parameter (f, parms, Qmenu_bar_lines, make_number (0), | ||
| 1974 | "menuBarLines", "MenuBarLines", number); | ||
| 1975 | |||
| 1930 | BLOCK_INPUT; | 1976 | BLOCK_INPUT; |
| 1931 | x_wm_set_size_hint (f, window_prompting); | 1977 | x_wm_set_size_hint (f, window_prompting); |
| 1932 | UNBLOCK_INPUT; | 1978 | UNBLOCK_INPUT; |
| @@ -1934,9 +1980,18 @@ be shared by the new frame.") | |||
| 1934 | tem = x_get_arg (parms, Qunsplittable, 0, 0, boolean); | 1980 | tem = x_get_arg (parms, Qunsplittable, 0, 0, boolean); |
| 1935 | f->no_split = minibuffer_only || EQ (tem, Qt); | 1981 | f->no_split = minibuffer_only || EQ (tem, Qt); |
| 1936 | 1982 | ||
| 1937 | /* Make the window appear on the frame and enable display. */ | 1983 | /* Make the window appear on the frame and enable display, |
| 1984 | unless the caller says not to. */ | ||
| 1938 | if (!EQ (x_get_arg (parms, Qsuppress_initial_map, 0, 0, boolean), Qt)) | 1985 | if (!EQ (x_get_arg (parms, Qsuppress_initial_map, 0, 0, boolean), Qt)) |
| 1939 | x_make_frame_visible (f); | 1986 | { |
| 1987 | tem = x_get_arg (parms, Qvisibility, 0, 0, boolean); | ||
| 1988 | if (EQ (tem, Qicon)) | ||
| 1989 | x_iconify_frame (f); | ||
| 1990 | /* Note that the default is Qunbound, | ||
| 1991 | so by default we do make visible. */ | ||
| 1992 | else if (!EQ (tem, Qnil)) | ||
| 1993 | x_make_frame_visible (f); | ||
| 1994 | } | ||
| 1940 | 1995 | ||
| 1941 | return frame; | 1996 | return frame; |
| 1942 | #else /* X10 */ | 1997 | #else /* X10 */ |
| @@ -3818,6 +3873,8 @@ syms_of_xfns () | |||
| 3818 | Qx_frame_parameter = intern ("x-frame-parameter"); | 3873 | Qx_frame_parameter = intern ("x-frame-parameter"); |
| 3819 | staticpro (&Qx_frame_parameter); | 3874 | staticpro (&Qx_frame_parameter); |
| 3820 | /* This is the end of symbol initialization. */ | 3875 | /* This is the end of symbol initialization. */ |
| 3876 | Qvisibility = intern ("visibility"); | ||
| 3877 | staticpro (&Qvisibility); | ||
| 3821 | 3878 | ||
| 3822 | Fput (Qundefined_color, Qerror_conditions, | 3879 | Fput (Qundefined_color, Qerror_conditions, |
| 3823 | Fcons (Qundefined_color, Fcons (Qerror, Qnil))); | 3880 | Fcons (Qundefined_color, Fcons (Qerror, Qnil))); |