Mercurial > hg > xemacs-beta
comparison src/frame.c @ 380:8626e4521993 r21-2-5
Import from CVS: tag r21-2-5
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:07:10 +0200 |
parents | cc15677e0335 |
children | bbff43aa5eb7 |
comparison
equal
deleted
inserted
replaced
379:76b7d63099ad | 380:8626e4521993 |
---|---|
36 #include "glyphs.h" | 36 #include "glyphs.h" |
37 #include "menubar.h" | 37 #include "menubar.h" |
38 #include "redisplay.h" | 38 #include "redisplay.h" |
39 #include "scrollbar.h" | 39 #include "scrollbar.h" |
40 #include "window.h" | 40 #include "window.h" |
41 | |
42 #include <errno.h> | |
43 #include "sysdep.h" | |
44 | 41 |
45 Lisp_Object Vselect_frame_hook, Qselect_frame_hook; | 42 Lisp_Object Vselect_frame_hook, Qselect_frame_hook; |
46 Lisp_Object Vdeselect_frame_hook, Qdeselect_frame_hook; | 43 Lisp_Object Vdeselect_frame_hook, Qdeselect_frame_hook; |
47 Lisp_Object Vcreate_frame_hook, Qcreate_frame_hook; | 44 Lisp_Object Vcreate_frame_hook, Qcreate_frame_hook; |
48 Lisp_Object Vdelete_frame_hook, Qdelete_frame_hook; | 45 Lisp_Object Vdelete_frame_hook, Qdelete_frame_hook; |
126 static Lisp_Object | 123 static Lisp_Object |
127 mark_frame (Lisp_Object obj, void (*markobj) (Lisp_Object)) | 124 mark_frame (Lisp_Object obj, void (*markobj) (Lisp_Object)) |
128 { | 125 { |
129 struct frame *f = XFRAME (obj); | 126 struct frame *f = XFRAME (obj); |
130 | 127 |
131 #define MARKED_SLOT(x) ((markobj) (f->x)); | 128 #define MARKED_SLOT(x) ((void) (markobj (f->x))); |
132 #include "frameslots.h" | 129 #include "frameslots.h" |
133 | 130 |
134 if (FRAME_LIVE_P (f)) /* device is nil for a dead frame */ | 131 if (FRAME_LIVE_P (f)) /* device is nil for a dead frame */ |
135 MAYBE_FRAMEMETH (f, mark_frame, (f, markobj)); | 132 MAYBE_FRAMEMETH (f, mark_frame, (f, markobj)); |
136 | 133 |
188 | 185 |
189 root_window = allocate_window (); | 186 root_window = allocate_window (); |
190 XWINDOW (root_window)->frame = frame; | 187 XWINDOW (root_window)->frame = frame; |
191 | 188 |
192 /* 10 is arbitrary, | 189 /* 10 is arbitrary, |
193 just so that there is "something there." | 190 Just so that there is "something there." |
194 Correct size will be set up later with change_frame_size. */ | 191 Correct size will be set up later with change_frame_size. */ |
195 | 192 |
196 f->width = 10; | 193 f->width = 10; |
197 f->height = 10; | 194 f->height = 10; |
198 | 195 |
199 XWINDOW (root_window)->pixel_width = 10; | 196 XWINDOW (root_window)->pixel_width = 10; |
200 XWINDOW (root_window)->pixel_height = 9; | 197 XWINDOW (root_window)->pixel_height = 9; |
201 | 198 |
578 } | 575 } |
579 | 576 |
580 void | 577 void |
581 invalidate_vertical_divider_cache_in_frame (struct frame *f) | 578 invalidate_vertical_divider_cache_in_frame (struct frame *f) |
582 { | 579 { |
583 /* Invalidate cached value of needs_vertical_divider_p in | 580 /* Invalidate cached value of needs_vertical_divider_p in |
584 every and all windows */ | 581 every and all windows */ |
585 map_windows (f, invalidate_vertical_divider_cache_in_window, 0); | 582 map_windows (f, invalidate_vertical_divider_cache_in_window, 0); |
586 } | 583 } |
587 | 584 |
588 /* | 585 /* |
890 if (!MINI_WINDOW_P (XWINDOW (window)) || FRAME_MINIBUF_ONLY_P (f)) | 887 if (!MINI_WINDOW_P (XWINDOW (window)) || FRAME_MINIBUF_ONLY_P (f)) |
891 { | 888 { |
892 #ifdef HAVE_TOOLBARS | 889 #ifdef HAVE_TOOLBARS |
893 if (!EQ (f->last_nonminibuf_window, window)) | 890 if (!EQ (f->last_nonminibuf_window, window)) |
894 MARK_TOOLBAR_CHANGED; | 891 MARK_TOOLBAR_CHANGED; |
895 #endif | 892 #endif |
896 f->last_nonminibuf_window = window; | 893 f->last_nonminibuf_window = window; |
897 } | 894 } |
898 } | 895 } |
899 | 896 |
900 DEFUN ("set-frame-selected-window", Fset_frame_selected_window, 2, 2, 0, /* | 897 DEFUN ("set-frame-selected-window", Fset_frame_selected_window, 2, 2, 0, /* |
2793 new_pixwidth += FRAME_SCROLLBAR_WIDTH (f); | 2790 new_pixwidth += FRAME_SCROLLBAR_WIDTH (f); |
2794 } | 2791 } |
2795 | 2792 |
2796 /* when frame_conversion_internal() calculated the number of rows/cols | 2793 /* when frame_conversion_internal() calculated the number of rows/cols |
2797 in the frame, the theoretical toolbar sizes were subtracted out. | 2794 in the frame, the theoretical toolbar sizes were subtracted out. |
2798 The caluclations below adjust for real toolbar height/width in | 2795 The calculations below adjust for real toolbar height/width in |
2799 frame, which may be different from frame spec, taking the above | 2796 frame, which may be different from frame spec, taking the above |
2800 fact into account */ | 2797 fact into account */ |
2801 new_pixheight += | 2798 new_pixheight += |
2802 + FRAME_THEORETICAL_TOP_TOOLBAR_HEIGHT (f) | 2799 + FRAME_THEORETICAL_TOP_TOOLBAR_HEIGHT (f) |
2803 + 2 * FRAME_THEORETICAL_TOP_TOOLBAR_BORDER_WIDTH (f) | 2800 + 2 * FRAME_THEORETICAL_TOP_TOOLBAR_BORDER_WIDTH (f) |
2804 - FRAME_REAL_TOP_TOOLBAR_HEIGHT (f) | 2801 - FRAME_REAL_TOP_TOOLBAR_HEIGHT (f) |
2805 - 2 * FRAME_REAL_TOP_TOOLBAR_BORDER_WIDTH (f); | 2802 - 2 * FRAME_REAL_TOP_TOOLBAR_BORDER_WIDTH (f); |
2806 | 2803 |
2807 new_pixheight += | 2804 new_pixheight += |
2808 + FRAME_THEORETICAL_BOTTOM_TOOLBAR_HEIGHT (f) | 2805 + FRAME_THEORETICAL_BOTTOM_TOOLBAR_HEIGHT (f) |
2809 + 2 * FRAME_THEORETICAL_BOTTOM_TOOLBAR_BORDER_WIDTH (f) | 2806 + 2 * FRAME_THEORETICAL_BOTTOM_TOOLBAR_BORDER_WIDTH (f) |
2810 - FRAME_REAL_BOTTOM_TOOLBAR_HEIGHT (f) | 2807 - FRAME_REAL_BOTTOM_TOOLBAR_HEIGHT (f) |
2811 - 2 * FRAME_REAL_BOTTOM_TOOLBAR_BORDER_WIDTH (f); | 2808 - 2 * FRAME_REAL_BOTTOM_TOOLBAR_BORDER_WIDTH (f); |
2813 new_pixwidth += | 2810 new_pixwidth += |
2814 + FRAME_THEORETICAL_LEFT_TOOLBAR_WIDTH (f) | 2811 + FRAME_THEORETICAL_LEFT_TOOLBAR_WIDTH (f) |
2815 + 2 * FRAME_THEORETICAL_LEFT_TOOLBAR_BORDER_WIDTH (f) | 2812 + 2 * FRAME_THEORETICAL_LEFT_TOOLBAR_BORDER_WIDTH (f) |
2816 - FRAME_REAL_LEFT_TOOLBAR_WIDTH (f) | 2813 - FRAME_REAL_LEFT_TOOLBAR_WIDTH (f) |
2817 - 2 * FRAME_REAL_LEFT_TOOLBAR_BORDER_WIDTH (f); | 2814 - 2 * FRAME_REAL_LEFT_TOOLBAR_BORDER_WIDTH (f); |
2818 | 2815 |
2819 new_pixwidth += | 2816 new_pixwidth += |
2820 + FRAME_THEORETICAL_RIGHT_TOOLBAR_WIDTH (f) | 2817 + FRAME_THEORETICAL_RIGHT_TOOLBAR_WIDTH (f) |
2821 + 2 * FRAME_THEORETICAL_RIGHT_TOOLBAR_BORDER_WIDTH (f) | 2818 + 2 * FRAME_THEORETICAL_RIGHT_TOOLBAR_BORDER_WIDTH (f) |
2822 - FRAME_REAL_RIGHT_TOOLBAR_WIDTH (f) | 2819 - FRAME_REAL_RIGHT_TOOLBAR_WIDTH (f) |
2823 - 2 * FRAME_REAL_RIGHT_TOOLBAR_BORDER_WIDTH (f); | 2820 - 2 * FRAME_REAL_RIGHT_TOOLBAR_BORDER_WIDTH (f); |
2824 | 2821 |
2825 /* Adjust the width for the end glyph which may be a different width | 2822 /* Adjust the width for the end glyph which may be a different width |
2826 than the default character width. */ | 2823 than the default character width. */ |
2827 { | 2824 { |
2828 int adjustment, trunc_width, cont_width; | 2825 int adjustment, trunc_width, cont_width; |
2829 | 2826 |
2905 else | 2902 else |
2906 { | 2903 { |
2907 FRAME_CHARWIDTH (f) = FRAME_WIDTH (f); | 2904 FRAME_CHARWIDTH (f) = FRAME_WIDTH (f); |
2908 FRAME_CHARHEIGHT (f) = FRAME_HEIGHT (f); | 2905 FRAME_CHARHEIGHT (f) = FRAME_HEIGHT (f); |
2909 } | 2906 } |
2910 | 2907 |
2911 MARK_FRAME_TOOLBARS_CHANGED (f); | 2908 MARK_FRAME_TOOLBARS_CHANGED (f); |
2912 MARK_FRAME_CHANGED (f); | 2909 MARK_FRAME_CHANGED (f); |
2913 f->echo_area_garbaged = 1; | 2910 f->echo_area_garbaged = 1; |
2914 } | 2911 } |
2915 | 2912 |