comparison src/frame.c @ 404:2f8bb876ab1d r21-2-32

Import from CVS: tag r21-2-32
author cvs
date Mon, 13 Aug 2007 11:16:07 +0200
parents a86b2b5e0111
children b8cc9ab3f761
comparison
equal deleted inserted replaced
403:9f011ab08d48 404:2f8bb876ab1d
465 init_frame_toolbars (f); 465 init_frame_toolbars (f);
466 #endif 466 #endif
467 reset_face_cachels (XWINDOW (FRAME_SELECTED_WINDOW (f))); 467 reset_face_cachels (XWINDOW (FRAME_SELECTED_WINDOW (f)));
468 reset_glyph_cachels (XWINDOW (FRAME_SELECTED_WINDOW (f))); 468 reset_glyph_cachels (XWINDOW (FRAME_SELECTED_WINDOW (f)));
469 reset_subwindow_cachels (f); 469 reset_subwindow_cachels (f);
470
470 change_frame_size (f, f->height, f->width, 0); 471 change_frame_size (f, f->height, f->width, 0);
471
472 } 472 }
473 473
474 MAYBE_FRAMEMETH (f, init_frame_2, (f, props)); 474 MAYBE_FRAMEMETH (f, init_frame_2, (f, props));
475 Fset_frame_properties (frame, props); 475 Fset_frame_properties (frame, props);
476 MAYBE_FRAMEMETH (f, init_frame_3, (f)); 476 MAYBE_FRAMEMETH (f, init_frame_3, (f));
477
478 /* now initialise the gutters, this won't change the frame size
479 so is ok here. */
480 if (!DEVICE_STREAM_P (d))
481 init_frame_gutters (f);
482 477
483 /* Hallelujah, praise the lord. */ 478 /* Hallelujah, praise the lord. */
484 f->init_finished = 1; 479 f->init_finished = 1;
485 480
486 /* If this is the first frame on the device, make it the selected one. */ 481 /* If this is the first frame on the device, make it the selected one. */
502 /* #### all this calling of frame methods at various odd times 497 /* #### all this calling of frame methods at various odd times
503 is somewhat of a mess. It's necessary to do it this way due 498 is somewhat of a mess. It's necessary to do it this way due
504 to strange console-type-specific things that need to be done. */ 499 to strange console-type-specific things that need to be done. */
505 MAYBE_FRAMEMETH (f, after_init_frame, (f, first_frame_on_device, 500 MAYBE_FRAMEMETH (f, after_init_frame, (f, first_frame_on_device,
506 first_frame_on_console)); 501 first_frame_on_console));
502
503 if (!DEVICE_STREAM_P (d))
504 {
505 /* Now initialise the gutters. This won't change the frame size,
506 but is needed as input to the layout that change_frame_size
507 will eventually do. Unfortunately gutter sizing code relies
508 on the frame in question being visible so we can't do this
509 earlier. */
510 init_frame_gutters (f);
511
512 change_frame_size (f, f->height, f->width, 0);
513 }
507 514
508 if (first_frame_on_device) 515 if (first_frame_on_device)
509 { 516 {
510 if (first_frame_on_console) 517 if (first_frame_on_console)
511 va_run_hook_with_args (Qcreate_console_hook, 1, DEVICE_CONSOLE (d)); 518 va_run_hook_with_args (Qcreate_console_hook, 1, DEVICE_CONSOLE (d));
903 { 910 {
904 assert (XFRAME (WINDOW_FRAME (XWINDOW (window))) == f); 911 assert (XFRAME (WINDOW_FRAME (XWINDOW (window))) == f);
905 f->selected_window = window; 912 f->selected_window = window;
906 if (!MINI_WINDOW_P (XWINDOW (window)) || FRAME_MINIBUF_ONLY_P (f)) 913 if (!MINI_WINDOW_P (XWINDOW (window)) || FRAME_MINIBUF_ONLY_P (f))
907 { 914 {
908 #ifdef HAVE_TOOLBARS
909 if (!EQ (f->last_nonminibuf_window, window)) 915 if (!EQ (f->last_nonminibuf_window, window))
910 { 916 {
917 #ifdef HAVE_TOOLBARS
911 MARK_TOOLBAR_CHANGED; 918 MARK_TOOLBAR_CHANGED;
919 #endif
912 MARK_GUTTER_CHANGED; 920 MARK_GUTTER_CHANGED;
913 } 921 }
914 #endif
915 f->last_nonminibuf_window = window; 922 f->last_nonminibuf_window = window;
916 } 923 }
917 } 924 }
918 925
919 DEFUN ("set-frame-selected-window", Fset_frame_selected_window, 2, 2, 0, /* 926 DEFUN ("set-frame-selected-window", Fset_frame_selected_window, 2, 2, 0, /*
2862 + FRAME_THEORETICAL_BOTTOM_TOOLBAR_HEIGHT (f) 2869 + FRAME_THEORETICAL_BOTTOM_TOOLBAR_HEIGHT (f)
2863 + 2 * FRAME_THEORETICAL_BOTTOM_TOOLBAR_BORDER_WIDTH (f) 2870 + 2 * FRAME_THEORETICAL_BOTTOM_TOOLBAR_BORDER_WIDTH (f)
2864 - FRAME_REAL_BOTTOM_TOOLBAR_HEIGHT (f) 2871 - FRAME_REAL_BOTTOM_TOOLBAR_HEIGHT (f)
2865 - 2 * FRAME_REAL_BOTTOM_TOOLBAR_BORDER_WIDTH (f); 2872 - 2 * FRAME_REAL_BOTTOM_TOOLBAR_BORDER_WIDTH (f);
2866 2873
2874 new_pixheight -=
2875 (FRAME_TOP_GUTTER_BOUNDS (f) + FRAME_BOTTOM_GUTTER_BOUNDS (f));
2876
2867 new_pixwidth += 2877 new_pixwidth +=
2868 + FRAME_THEORETICAL_LEFT_TOOLBAR_WIDTH (f) 2878 + FRAME_THEORETICAL_LEFT_TOOLBAR_WIDTH (f)
2869 + 2 * FRAME_THEORETICAL_LEFT_TOOLBAR_BORDER_WIDTH (f) 2879 + 2 * FRAME_THEORETICAL_LEFT_TOOLBAR_BORDER_WIDTH (f)
2870 - FRAME_REAL_LEFT_TOOLBAR_WIDTH (f) 2880 - FRAME_REAL_LEFT_TOOLBAR_WIDTH (f)
2871 - 2 * FRAME_REAL_LEFT_TOOLBAR_BORDER_WIDTH (f); 2881 - 2 * FRAME_REAL_LEFT_TOOLBAR_BORDER_WIDTH (f);
2873 new_pixwidth += 2883 new_pixwidth +=
2874 + FRAME_THEORETICAL_RIGHT_TOOLBAR_WIDTH (f) 2884 + FRAME_THEORETICAL_RIGHT_TOOLBAR_WIDTH (f)
2875 + 2 * FRAME_THEORETICAL_RIGHT_TOOLBAR_BORDER_WIDTH (f) 2885 + 2 * FRAME_THEORETICAL_RIGHT_TOOLBAR_BORDER_WIDTH (f)
2876 - FRAME_REAL_RIGHT_TOOLBAR_WIDTH (f) 2886 - FRAME_REAL_RIGHT_TOOLBAR_WIDTH (f)
2877 - 2 * FRAME_REAL_RIGHT_TOOLBAR_BORDER_WIDTH (f); 2887 - 2 * FRAME_REAL_RIGHT_TOOLBAR_BORDER_WIDTH (f);
2888
2889 new_pixwidth -=
2890 (FRAME_LEFT_GUTTER_BOUNDS (f) + FRAME_RIGHT_GUTTER_BOUNDS (f));
2878 2891
2879 /* Adjust the width for the end glyph which may be a different width 2892 /* Adjust the width for the end glyph which may be a different width
2880 than the default character width. */ 2893 than the default character width. */
2881 { 2894 {
2882 int adjustment, trunc_width, cont_width; 2895 int adjustment, trunc_width, cont_width;
2895 if (!new_pixheight && !new_pixwidth) 2908 if (!new_pixheight && !new_pixwidth)
2896 return; 2909 return;
2897 2910
2898 if (new_pixheight) 2911 if (new_pixheight)
2899 { 2912 {
2900 XWINDOW (FRAME_ROOT_WINDOW (f))->pixel_top = FRAME_TOP_BORDER_END (f); 2913 XWINDOW (FRAME_ROOT_WINDOW (f))->pixel_top
2914 = FRAME_TOP_BORDER_END (f) + FRAME_TOP_GUTTER_BOUNDS (f);
2901 2915
2902 if (FRAME_HAS_MINIBUF_P (f) 2916 if (FRAME_HAS_MINIBUF_P (f)
2903 && ! FRAME_MINIBUF_ONLY_P (f)) 2917 && ! FRAME_MINIBUF_ONLY_P (f))
2904 /* Frame has both root and minibuffer. */ 2918 /* Frame has both root and minibuffer. */
2905 { 2919 {
2921 set_window_pixheight (FRAME_ROOT_WINDOW (f), 2935 set_window_pixheight (FRAME_ROOT_WINDOW (f),
2922 /* - font_height for minibuffer */ 2936 /* - font_height for minibuffer */
2923 new_pixheight - minibuf_height, 0); 2937 new_pixheight - minibuf_height, 0);
2924 2938
2925 XWINDOW (FRAME_MINIBUF_WINDOW (f))->pixel_top = 2939 XWINDOW (FRAME_MINIBUF_WINDOW (f))->pixel_top =
2926 new_pixheight - minibuf_height + FRAME_TOP_BORDER_END (f); 2940 FRAME_TOP_BORDER_END (f) +
2941 FRAME_TOP_GUTTER_BOUNDS (f) +
2942 FRAME_BOTTOM_GUTTER_BOUNDS (f) +
2943 new_pixheight - minibuf_height;
2927 2944
2928 set_window_pixheight (FRAME_MINIBUF_WINDOW (f), minibuf_height, 0); 2945 set_window_pixheight (FRAME_MINIBUF_WINDOW (f), minibuf_height, 0);
2929 } 2946 }
2930 else 2947 else
2931 /* Frame has just one top-level window. */ 2948 /* Frame has just one top-level window. */
2936 f->pixheight = newheight; 2953 f->pixheight = newheight;
2937 } 2954 }
2938 2955
2939 if (new_pixwidth) 2956 if (new_pixwidth)
2940 { 2957 {
2941 XWINDOW (FRAME_ROOT_WINDOW (f))->pixel_left = FRAME_LEFT_BORDER_END (f); 2958 XWINDOW (FRAME_ROOT_WINDOW (f))->pixel_left =
2959 FRAME_LEFT_BORDER_END (f) + FRAME_LEFT_GUTTER_BOUNDS (f);
2942 set_window_pixwidth (FRAME_ROOT_WINDOW (f), new_pixwidth, 0); 2960 set_window_pixwidth (FRAME_ROOT_WINDOW (f), new_pixwidth, 0);
2943 2961
2944 if (FRAME_HAS_MINIBUF_P (f)) 2962 if (FRAME_HAS_MINIBUF_P (f))
2945 { 2963 {
2946 XWINDOW (FRAME_MINIBUF_WINDOW (f))->pixel_left = 2964 XWINDOW (FRAME_MINIBUF_WINDOW (f))->pixel_left =
2947 FRAME_LEFT_BORDER_END (f); 2965 FRAME_LEFT_BORDER_END (f) + FRAME_LEFT_GUTTER_BOUNDS (f);
2948 set_window_pixwidth (FRAME_MINIBUF_WINDOW (f), new_pixwidth, 0); 2966 set_window_pixwidth (FRAME_MINIBUF_WINDOW (f), new_pixwidth, 0);
2949 } 2967 }
2950 2968
2951 FRAME_WIDTH (f) = newwidth; 2969 FRAME_WIDTH (f) = newwidth;
2952 if (FRAME_TTY_P (f)) 2970 if (FRAME_TTY_P (f))
2961 FRAME_CHARWIDTH (f) = FRAME_WIDTH (f); 2979 FRAME_CHARWIDTH (f) = FRAME_WIDTH (f);
2962 FRAME_CHARHEIGHT (f) = FRAME_HEIGHT (f); 2980 FRAME_CHARHEIGHT (f) = FRAME_HEIGHT (f);
2963 } 2981 }
2964 2982
2965 MARK_FRAME_TOOLBARS_CHANGED (f); 2983 MARK_FRAME_TOOLBARS_CHANGED (f);
2984 MARK_FRAME_GUTTERS_CHANGED (f);
2966 MARK_FRAME_CHANGED (f); 2985 MARK_FRAME_CHANGED (f);
2967 f->echo_area_garbaged = 1; 2986 f->echo_area_garbaged = 1;
2968 } 2987 }
2969 2988
2970 void 2989 void
3370 visible frames. 3389 visible frames.
3371 */ ); 3390 */ );
3372 Vsynchronize_minibuffers = Qnil; 3391 Vsynchronize_minibuffers = Qnil;
3373 3392
3374 DEFVAR_LISP ("frame-title-format", &Vframe_title_format /* 3393 DEFVAR_LISP ("frame-title-format", &Vframe_title_format /*
3375 Controls the title of the X window corresponding to the selected frame. 3394 Controls the title of the window-system window of the selected frame.
3376 This is the same format as `modeline-format' with the exception that 3395 This is the same format as `modeline-format' with the exception that
3377 %- is ignored. 3396 %- is ignored.
3378 */ ); 3397 */ );
3398 /* #### I would change this unilaterally but for the wrath of the Kyles
3399 of the world. */
3400 #ifdef WINDOWSNT
3401 Vframe_title_format = build_string ("%b - XEmacs");
3402 #else
3379 Vframe_title_format = build_string ("%S: %b"); 3403 Vframe_title_format = build_string ("%S: %b");
3404 #endif
3380 3405
3381 DEFVAR_LISP ("frame-icon-title-format", &Vframe_icon_title_format /* 3406 DEFVAR_LISP ("frame-icon-title-format", &Vframe_icon_title_format /*
3382 Controls the title of the icon corresponding to the selected frame. 3407 Controls the title of the icon corresponding to the selected frame.
3383 See also the variable `frame-title-format'. 3408 See also the variable `frame-title-format'.
3384 */ ); 3409 */ );
3385 Vframe_icon_title_format = build_string ("%b"); 3410 Vframe_icon_title_format = build_string ("%b");
3386 3411
3387 DEFVAR_LISP ("default-frame-name", &Vdefault_frame_name /* 3412 DEFVAR_LISP ("default-frame-name", &Vdefault_frame_name /*
3388 The default name to assign to newly-created frames. 3413 The default name to assign to newly-created frames.
3389 This can be overridden by arguments to `make-frame'. 3414 This can be overridden by arguments to `make-frame'. This must be a string.
3390 This must be a string. 3415 This is used primarily for picking up X resources, and is *not* the title
3416 of the frame. (See `frame-title-format'.)
3391 */ ); 3417 */ );
3392 #ifndef INFODOCK 3418 #ifndef INFODOCK
3393 Vdefault_frame_name = build_string ("emacs"); 3419 Vdefault_frame_name = build_string ("emacs");
3394 #else 3420 #else
3395 Vdefault_frame_name = build_string ("InfoDock"); 3421 Vdefault_frame_name = build_string ("InfoDock");