comparison src/window.c @ 284:558f606b08ae r21-0b40

Import from CVS: tag r21-0b40
author cvs
date Mon, 13 Aug 2007 10:34:13 +0200
parents c42ec1d1cded
children 57709be46d1b
comparison
equal deleted inserted replaced
283:fa3d41851a08 284:558f606b08ae
66 int inpixels); 66 int inpixels);
67 67
68 /* Thickness of shadow border around 3d modelines. */ 68 /* Thickness of shadow border around 3d modelines. */
69 Lisp_Object Vmodeline_shadow_thickness; 69 Lisp_Object Vmodeline_shadow_thickness;
70 70
71 /* Whether vertical dividers are draggable and displayed */
72 Lisp_Object Vvertical_divider_draggable_p;
73
71 /* Whether a modeline should be displayed. */ 74 /* Whether a modeline should be displayed. */
72 Lisp_Object Vhas_modeline_p; 75 Lisp_Object Vhas_modeline_p;
76
77 /* Thickness of shadow border around vertical dividers. */
78 Lisp_Object Vvertical_divider_shadow_thickness;
79
80 /* Divider surface width (not counting 3-d borders) */
81 Lisp_Object Vvertical_divider_line_width;
82
83 /* Spacing between outer egde of divider border and window edge */
84 Lisp_Object Vvertical_divider_spacing;
73 85
74 /* Scroll if point lands on the bottom line and that line is partially 86 /* Scroll if point lands on the bottom line and that line is partially
75 clipped. */ 87 clipped. */
76 int scroll_on_clipped_lines; 88 int scroll_on_clipped_lines;
77 89
148 MARK_DISP_VARIABLE (last_point); 160 MARK_DISP_VARIABLE (last_point);
149 MARK_DISP_VARIABLE (last_start); 161 MARK_DISP_VARIABLE (last_start);
150 MARK_DISP_VARIABLE (last_facechange); 162 MARK_DISP_VARIABLE (last_facechange);
151 ((markobj) (window->line_cache_last_updated)); 163 ((markobj) (window->line_cache_last_updated));
152 ((markobj) (window->redisplay_end_trigger)); 164 ((markobj) (window->redisplay_end_trigger));
153 /* Cached specifiers: */
154 ((markobj) (window->display_table));
155 ((markobj) (window->has_modeline_p));
156 ((markobj) (window->modeline_shadow_thickness));
157 #ifdef HAVE_SCROLLBARS
158 ((markobj) (window->scrollbar_width));
159 ((markobj) (window->scrollbar_height));
160 ((markobj) (window->horizontal_scrollbar_visible_p));
161 ((markobj) (window->vertical_scrollbar_visible_p));
162 ((markobj) (window->scrollbar_on_left_p));
163 ((markobj) (window->scrollbar_on_top_p));
164 ((markobj) (window->scrollbar_pointer));
165 #endif /* HAVE_SCROLLBARS */
166 ((markobj) (window->left_margin_width));
167 ((markobj) (window->right_margin_width));
168 #ifdef HAVE_TOOLBARS
169 ((markobj) (window->toolbar[0]));
170 ((markobj) (window->toolbar[1]));
171 ((markobj) (window->toolbar[2]));
172 ((markobj) (window->toolbar[3]));
173 ((markobj) (window->toolbar_size[0]));
174 ((markobj) (window->toolbar_size[1]));
175 ((markobj) (window->toolbar_size[2]));
176 ((markobj) (window->toolbar_size[3]));
177 ((markobj) (window->toolbar_visible_p[0]));
178 ((markobj) (window->toolbar_visible_p[1]));
179 ((markobj) (window->toolbar_visible_p[2]));
180 ((markobj) (window->toolbar_visible_p[3]));
181 ((markobj) (window->toolbar_buttons_captioned_p));
182 ((markobj) (window->default_toolbar));
183 ((markobj) (window->default_toolbar_height));
184 ((markobj) (window->default_toolbar_width));
185 ((markobj) (window->default_toolbar_visible_p));
186 #endif /* HAVE_TOOLBARS */
187 ((markobj) (window->minimum_line_ascent));
188 ((markobj) (window->minimum_line_descent));
189 ((markobj) (window->use_left_overflow));
190 ((markobj) (window->use_right_overflow));
191 #ifdef HAVE_MENUBARS
192 ((markobj) (window->menubar_visible_p));
193 #endif /* HAVE_MENUBARS */
194 ((markobj) (window->text_cursor_visible_p));
195 /* End cached specifiers. */
196 ((markobj) (window->dedicated));
197 mark_face_cachels (window->face_cachels, markobj); 165 mark_face_cachels (window->face_cachels, markobj);
198 mark_glyph_cachels (window->glyph_cachels, markobj); 166 mark_glyph_cachels (window->glyph_cachels, markobj);
167
168 #define WINDOW_SLOT(slot, compare) ((markobj) (window->slot))
169 #include "winslots.h"
170
199 return Qnil; 171 return Qnil;
200 } 172 }
201 173
202 static void 174 static void
203 print_window (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) 175 print_window (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag)
305 p->line_cache_last_updated = Qzero; 277 p->line_cache_last_updated = Qzero;
306 INIT_DISP_VARIABLE (last_point_x, 0); 278 INIT_DISP_VARIABLE (last_point_x, 0);
307 INIT_DISP_VARIABLE (last_point_y, 0); 279 INIT_DISP_VARIABLE (last_point_y, 0);
308 INIT_DISP_VARIABLE (window_end_pos, 0); 280 INIT_DISP_VARIABLE (window_end_pos, 0);
309 p->redisplay_end_trigger = Qnil; 281 p->redisplay_end_trigger = Qnil;
310 /* cached specifier values: will get set properly later */ 282
311 p->display_table = Qnil; 283 #define WINDOW_SLOT(slot, compare) p->slot = Qnil
312 p->has_modeline_p = Qnil; 284 #include "winslots.h"
313 p->modeline_shadow_thickness = Qnil; 285
314 #ifdef HAVE_SCROLLBARS
315 p->scrollbar_width = Qnil;
316 p->scrollbar_height = Qnil;
317 p->horizontal_scrollbar_visible_p = Qnil;
318 p->vertical_scrollbar_visible_p = Qnil;
319 p->scrollbar_on_left_p = Qnil;
320 p->scrollbar_on_top_p = Qnil;
321 #endif
322 p->left_margin_width = Qnil;
323 p->right_margin_width = Qnil;
324 #ifdef HAVE_TOOLBARS
325 p->toolbar_size[0] = Qnil;
326 p->toolbar_size[1] = Qnil;
327 p->toolbar_size[2] = Qnil;
328 p->toolbar_size[3] = Qnil;
329 p->toolbar_buttons_captioned_p = Qnil;
330 #endif
331 p->minimum_line_ascent = Qnil;
332 p->minimum_line_descent = Qnil;
333 p->use_left_overflow = Qnil;
334 p->use_right_overflow = Qnil;
335 #ifdef HAVE_MENUBARS
336 p->menubar_visible_p = Qnil;
337 #endif
338 p->text_cursor_visible_p = Qnil;
339 /* end cached specifier values. */
340
341 p->dedicated = Qnil;
342 p->windows_changed = 1; 286 p->windows_changed = 1;
343 p->shadow_thickness_changed = 1; 287 p->shadow_thickness_changed = 1;
344 288
345 return val; 289 return val;
346 } 290 }
774 718
775 return 0; 719 return 0;
776 } 720 }
777 721
778 int 722 int
723 have_undivided_common_edge (struct window *w_right, void *closure)
724 {
725 struct window *w_left = (struct window *) closure;
726 return (WINDOW_RIGHT (w_left) == WINDOW_LEFT (w_right)
727 && WINDOW_TOP (w_left) < WINDOW_BOTTOM (w_right)
728 && WINDOW_TOP (w_right) < WINDOW_BOTTOM (w_left)
729 #ifdef HAVE_SCROLLBARS
730 && (NILP (w_right->scrollbar_on_left_p)
731 || NILP (w_right->vertical_scrollbar_visible_p)
732 || ZEROP (w_right->scrollbar_width))
733 #endif
734 );
735 }
736
737 static int
738 window_needs_vertical_divider_1 (struct window *w)
739 {
740 /* Never if we're on the right */
741 if (window_is_rightmost (w))
742 return 0;
743
744 /* Always if draggable */
745 if (!NILP (w->vertical_divider_draggable_p))
746 return 1;
747
748 #ifdef HAVE_SCROLLBARS
749 /* Our right scrollabr is enough to separate us at the right */
750 if (NILP (w->scrollbar_on_left_p)
751 && !NILP (w->vertical_scrollbar_visible_p)
752 && !ZEROP (w->scrollbar_width))
753 return 0;
754 #endif
755
756 /* Ok. to determine whether we need a divider on the left, we must
757 check that out right neighbor windows have scrollbars on their
758 left sides. We mist check all such windows which have common
759 left edge with our window's right edge. */
760 return map_windows (XFRAME (WINDOW_FRAME (w)),
761 have_undivided_common_edge, (void*)w);
762 }
763
764 int
779 window_needs_vertical_divider (struct window *w) 765 window_needs_vertical_divider (struct window *w)
780 { 766 {
781 #ifdef HAVE_SCROLLBARS 767 if (!w->need_vertical_divider_valid_p)
782 return (!window_scrollbar_width (w) && 768 {
783 (!NILP (w->scrollbar_on_left_p) ? 769 w->need_vertical_divider_p =
784 !window_is_leftmost (w) : 770 window_needs_vertical_divider_1 (w);
785 !window_is_rightmost (w))); 771 w->need_vertical_divider_valid_p = 1;
786 #else 772 }
787 return !window_is_leftmost (w); 773 return w->need_vertical_divider_p;
788 #endif /* HAVE_SCROLLBARS */ 774 }
775
776 /* Called from invalidate_vertical_divider_cache_in_frame */
777 int
778 invalidate_vertical_divider_cache_in_window (struct window *w,
779 void *u_n_u_s_e_d)
780 {
781 w->need_vertical_divider_valid_p = 0;
782 return 0;
783 }
784
785 /* Calculate width of vertical divider, including its shadows
786 and spacing. The returned value is effectively the distance
787 between adjacent window edges. This function does not check
788 whether a windows needs vertival divider, so the returned
789 value is a "theoretical" one */
790 int
791 window_divider_width (struct window *w)
792 {
793 /* the shadow thickness can be negative. This means that the divider
794 will have a depressed look */
795
796 if (FRAME_WIN_P (XFRAME (WINDOW_FRAME (w))))
797 return
798 XINT (w->vertical_divider_line_width)
799 + 2 * XINT (w->vertical_divider_spacing)
800 + 2 * abs (XINT (w->vertical_divider_shadow_thickness));
801 else
802 return XINT (w->vertical_divider_line_width) == 0 ? 0 : 1;
789 } 803 }
790 804
791 int 805 int
792 window_scrollbar_width (struct window *w) 806 window_scrollbar_width (struct window *w)
793 { 807 {
1031 else 1045 else
1032 #endif 1046 #endif
1033 return other_height; 1047 return other_height;
1034 } 1048 }
1035 1049
1036 static int 1050 int
1037 window_left_right_gutter_width_internal (struct window *w, int modeline) 1051 window_left_gutter_width (struct window *w, int modeline)
1038 { 1052 {
1039 struct frame *f = XFRAME (w->frame); 1053 int gutter = window_left_toolbar_width (w);
1040 int scrollbar_width = window_scrollbar_width (w); 1054
1041
1042 if (!NILP (w->hchild) || !NILP (w->vchild)) 1055 if (!NILP (w->hchild) || !NILP (w->vchild))
1043 return 0; 1056 return 0;
1044 1057
1045 if (!modeline) 1058
1046 { 1059 #ifdef HAVE_SCROLLBARS
1047 if (scrollbar_width) 1060 if (!modeline && !NILP (w->scrollbar_on_left_p))
1048 return scrollbar_width; 1061 gutter += window_scrollbar_width (w);
1049 else if (window_needs_vertical_divider (w)) 1062 #endif
1050 return FRAMEMETH (f, divider_width, ()); 1063
1051 else 1064 return gutter;
1052 return 0;
1053 }
1054 else
1055 {
1056 /* The shadows on the 3D modelines provide a visual break
1057 between the modelines of horizontally split windows. 2D
1058 modelines need some help, though. */
1059 if (!EQ (Qzero, w->modeline_shadow_thickness))
1060 return 0;
1061 else if (window_needs_vertical_divider (w))
1062 return FRAMEMETH (f, divider_width, ());
1063 else
1064 return 0;
1065 }
1066 } 1065 }
1067 1066
1068 int 1067 int
1069 window_left_gutter_width (struct window *w, int modeline) 1068 window_right_gutter_width (struct window *w, int modeline)
1070 { 1069 {
1070 int gutter = window_left_toolbar_width (w);
1071
1071 if (!NILP (w->hchild) || !NILP (w->vchild)) 1072 if (!NILP (w->hchild) || !NILP (w->vchild))
1072 return 0; 1073 return 0;
1073 1074
1074 #ifdef HAVE_SCROLLBARS 1075 #ifdef HAVE_SCROLLBARS
1075 if (!NILP (w->scrollbar_on_left_p)) 1076 if (!modeline && NILP (w->scrollbar_on_left_p))
1076 { 1077 gutter += window_scrollbar_width (w);
1077 #endif 1078 #endif
1078 return (window_left_right_gutter_width_internal (w, modeline) + 1079
1079 window_left_toolbar_width (w)); 1080 if (window_needs_vertical_divider (w))
1080 #ifdef HAVE_SCROLLBARS 1081 gutter += window_divider_width (w);
1081 } 1082
1082 else 1083 return gutter;
1083 return window_left_toolbar_width (w);
1084 #endif
1085 }
1086
1087 int
1088 window_right_gutter_width (struct window *w, int modeline)
1089 {
1090 if (!NILP (w->hchild) || !NILP (w->vchild))
1091 return 0;
1092
1093 #ifdef HAVE_SCROLLBARS
1094 if (NILP (w->scrollbar_on_left_p))
1095 {
1096 return (window_left_right_gutter_width_internal (w, modeline) +
1097 window_right_toolbar_width (w));
1098 }
1099 else
1100 #endif
1101 return window_right_toolbar_width (w);
1102 } 1084 }
1103 1085
1104 1086
1105 DEFUN ("windowp", Fwindowp, 1, 1, 0, /* 1087 DEFUN ("windowp", Fwindowp, 1, 1, 0, /*
1106 Return t if OBJ is a window. 1088 Return t if OBJ is a window.
4377 non-zero, the mapping is halted. Otherwise, map_windows() maps 4359 non-zero, the mapping is halted. Otherwise, map_windows() maps
4378 over all windows in F. 4360 over all windows in F.
4379 4361
4380 If MAPFUN create or delete windows, the behaviour is undefined. */ 4362 If MAPFUN create or delete windows, the behaviour is undefined. */
4381 4363
4382 void 4364 int
4383 map_windows (struct frame *f, int (*mapfun) (struct window *w, void *closure), 4365 map_windows (struct frame *f, int (*mapfun) (struct window *w, void *closure),
4384 void *closure) 4366 void *closure)
4385 { 4367 {
4386 if (f) 4368 if (f)
4387 map_windows_1 (FRAME_ROOT_WINDOW (f), mapfun, closure); 4369 return map_windows_1 (FRAME_ROOT_WINDOW (f), mapfun, closure);
4388 else 4370 else
4389 { 4371 {
4390 Lisp_Object frmcons, devcons, concons; 4372 Lisp_Object frmcons, devcons, concons;
4391 4373
4392 FRAME_LOOP_NO_BREAK(frmcons, devcons, concons) 4374 FRAME_LOOP_NO_BREAK(frmcons, devcons, concons)
4393 { 4375 {
4394 if (map_windows_1 (FRAME_ROOT_WINDOW (XFRAME (XCAR (frmcons))), 4376 int v = map_windows_1 (FRAME_ROOT_WINDOW (XFRAME (XCAR (frmcons))),
4395 mapfun, closure)) 4377 mapfun, closure);
4396 return; 4378 if (v)
4379 return v;
4397 } 4380 }
4398 } 4381 }
4399 } 4382 }
4400 4383
4401 4384
4403 modeline_shadow_thickness_changed (Lisp_Object specifier, struct window *w, 4386 modeline_shadow_thickness_changed (Lisp_Object specifier, struct window *w,
4404 Lisp_Object oldval) 4387 Lisp_Object oldval)
4405 { 4388 {
4406 w->shadow_thickness_changed = 1; 4389 w->shadow_thickness_changed = 1;
4407 MARK_WINDOWS_CHANGED (w); 4390 MARK_WINDOWS_CHANGED (w);
4391 }
4392
4393 static void
4394 vertical_divider_changed_in_window (Lisp_Object specifier,
4395 struct window *w,
4396 Lisp_Object oldval)
4397 {
4398 MARK_WINDOWS_CHANGED (w);
4399 MARK_FRAME_WINDOWS_STRUCTURE_CHANGED (XFRAME (WINDOW_FRAME (w)));
4408 } 4400 }
4409 4401
4410 /* also used in scrollbar.c */ 4402 /* also used in scrollbar.c */
4411 void 4403 void
4412 some_window_value_changed (Lisp_Object specifier, struct window *w, 4404 some_window_value_changed (Lisp_Object specifier, struct window *w,
4541 int pixel_height; 4533 int pixel_height;
4542 int hscroll; 4534 int hscroll;
4543 int modeline_hscroll; 4535 int modeline_hscroll;
4544 int parent_index; /* index into saved_windows */ 4536 int parent_index; /* index into saved_windows */
4545 int prev_index; /* index into saved_windows */ 4537 int prev_index; /* index into saved_windows */
4546 Lisp_Object dedicated;
4547 char start_at_line_beg; /* boolean */ 4538 char start_at_line_beg; /* boolean */
4548 Lisp_Object display_table; 4539
4549 Lisp_Object modeline_shadow_thickness; 4540 #define WINDOW_SLOT_DECLARATION
4550 Lisp_Object has_modeline_p; 4541 #define WINDOW_SLOT(slot, compare) Lisp_Object slot
4551 #ifdef HAVE_SCROLLBARS 4542 #include "winslots.h"
4552 Lisp_Object scrollbar_width;
4553 Lisp_Object scrollbar_height;
4554 Lisp_Object horizontal_scrollbar_visible_p;
4555 Lisp_Object vertical_scrollbar_visible_p;
4556 Lisp_Object scrollbar_on_left_p;
4557 Lisp_Object scrollbar_on_top_p;
4558 Lisp_Object scrollbar_pointer;
4559 #endif /* HAVE_SCROLLBARS */
4560 #ifdef HAVE_TOOLBARS
4561 Lisp_Object toolbar[4];
4562 Lisp_Object toolbar_size[4];
4563 Lisp_Object toolbar_border_width[4];
4564 Lisp_Object toolbar_visible_p[4];
4565 Lisp_Object toolbar_buttons_captioned_p;
4566 Lisp_Object default_toolbar;
4567 Lisp_Object default_toolbar_width, default_toolbar_height;
4568 Lisp_Object default_toolbar_visible_p;
4569 Lisp_Object default_toolbar_border_width;
4570 #endif /* HAVE_TOOLBARS */
4571 Lisp_Object left_margin_width, right_margin_width;
4572 Lisp_Object minimum_line_ascent, minimum_line_descent;
4573 Lisp_Object use_left_overflow, use_right_overflow;
4574 #ifdef HAVE_MENUBARS
4575 Lisp_Object menubar_visible_p;
4576 #endif /* HAVE_MENUBARS */
4577 Lisp_Object text_cursor_visible_p;
4578 }; 4543 };
4579 4544
4580 /* If you add anything to this structure make sure window_config_equal 4545 /* If you add anything to this structure make sure window_config_equal
4581 knows about it. */ 4546 knows about it. */
4582 struct window_config 4547 struct window_config
4623 ((markobj) (s->buffer)); 4588 ((markobj) (s->buffer));
4624 ((markobj) (s->start)); 4589 ((markobj) (s->start));
4625 ((markobj) (s->pointm)); 4590 ((markobj) (s->pointm));
4626 ((markobj) (s->sb_point)); 4591 ((markobj) (s->sb_point));
4627 ((markobj) (s->mark)); 4592 ((markobj) (s->mark));
4593 #if 0
4594 /* #### This looked like this. I do not see why specifier cached
4595 values should not be marked, as such specifiers as toolbars
4596 might have GC-able instances. Freed configs are not marked,
4597 aren't they? -- kkm */
4628 ((markobj) (s->dedicated)); 4598 ((markobj) (s->dedicated));
4599 #else
4600 #define WINDOW_SLOT(slot, compare) ((markobj) (s->slot))
4601 #include "winslots.h"
4602 #endif
4629 } 4603 }
4630 return Qnil; 4604 return Qnil;
4631 } 4605 }
4632 4606
4633 static size_t 4607 static size_t
4669 /* Returns a boolean indicating whether the two saved windows are 4643 /* Returns a boolean indicating whether the two saved windows are
4670 identical. */ 4644 identical. */
4671 static int 4645 static int
4672 saved_window_equal (struct saved_window *win1, struct saved_window *win2) 4646 saved_window_equal (struct saved_window *win1, struct saved_window *win2)
4673 { 4647 {
4648 #define WINDOW_SLOT(slot, compare) \
4649 if (!compare (win1->slot, win2->slot)) \
4650 return 0;
4651 #include "winslots.h"
4652
4674 return 4653 return
4675 EQ (win1->window, win2->window) && 4654 EQ (win1->window, win2->window) &&
4676 EQ (win1->buffer, win2->buffer) && 4655 EQ (win1->buffer, win2->buffer) &&
4677 internal_equal (win1->start, win2->start, 0) && 4656 internal_equal (win1->start, win2->start, 0) &&
4678 internal_equal (win1->pointm, win2->pointm, 0) && 4657 internal_equal (win1->pointm, win2->pointm, 0) &&
4684 win1->pixel_height == win2->pixel_height && 4663 win1->pixel_height == win2->pixel_height &&
4685 win1->hscroll == win2->hscroll && 4664 win1->hscroll == win2->hscroll &&
4686 win1->modeline_hscroll == win2->modeline_hscroll && 4665 win1->modeline_hscroll == win2->modeline_hscroll &&
4687 win1->parent_index == win2->parent_index && 4666 win1->parent_index == win2->parent_index &&
4688 win1->prev_index == win2->prev_index && 4667 win1->prev_index == win2->prev_index &&
4689 EQ (win1->dedicated, win2->dedicated) && 4668 win1->start_at_line_beg == win2->start_at_line_beg;
4690 win1->start_at_line_beg == win2->start_at_line_beg &&
4691 internal_equal(win1->display_table, win2->display_table, 0) &&
4692 EQ(win1->modeline_shadow_thickness, win2->modeline_shadow_thickness) &&
4693 EQ(win1->has_modeline_p, win2->has_modeline_p) &&
4694 #ifdef HAVE_SCROLLBARS
4695 EQ(win1->scrollbar_width, win2->scrollbar_width) &&
4696 EQ(win1->scrollbar_height, win2->scrollbar_height) &&
4697 EQ(win1->horizontal_scrollbar_visible_p, win2->horizontal_scrollbar_visible_p) &&
4698 EQ(win1->vertical_scrollbar_visible_p, win2->vertical_scrollbar_visible_p) &&
4699 EQ(win1->scrollbar_on_left_p, win2->scrollbar_on_left_p) &&
4700 EQ(win1->scrollbar_on_top_p, win2->scrollbar_on_top_p) &&
4701 EQ(win1->scrollbar_pointer, win2->scrollbar_pointer) &&
4702 #endif /* HAVE_SCROLLBARS */
4703 #ifdef HAVE_TOOLBARS
4704 internal_equal(win1->toolbar[0], win2->toolbar[0], 0) &&
4705 internal_equal(win1->toolbar[1], win2->toolbar[1], 0) &&
4706 internal_equal(win1->toolbar[2], win2->toolbar[2], 0) &&
4707 internal_equal(win1->toolbar[3], win2->toolbar[3], 0) &&
4708 internal_equal(win1->toolbar_border_width[0], win2->toolbar_border_width[0], 0) &&
4709 internal_equal(win1->toolbar_border_width[1], win2->toolbar_border_width[1], 0) &&
4710 internal_equal(win1->toolbar_border_width[2], win2->toolbar_border_width[2], 0) &&
4711 internal_equal(win1->toolbar_border_width[3], win2->toolbar_border_width[3], 0) &&
4712 internal_equal(win1->toolbar_size[0], win2->toolbar_size[0], 0) &&
4713 internal_equal(win1->toolbar_size[1], win2->toolbar_size[1], 0) &&
4714 internal_equal(win1->toolbar_size[2], win2->toolbar_size[2], 0) &&
4715 internal_equal(win1->toolbar_size[3], win2->toolbar_size[3], 0) &&
4716 internal_equal(win1->toolbar_visible_p[0], win2->toolbar_visible_p[0], 0) &&
4717 internal_equal(win1->toolbar_visible_p[1], win2->toolbar_visible_p[1], 0) &&
4718 internal_equal(win1->toolbar_visible_p[2], win2->toolbar_visible_p[2], 0) &&
4719 internal_equal(win1->toolbar_visible_p[3], win2->toolbar_visible_p[3], 0) &&
4720 EQ(win1->toolbar_buttons_captioned_p, win2->toolbar_buttons_captioned_p) &&
4721 internal_equal(win1->default_toolbar, win2->default_toolbar, 0) &&
4722 EQ(win1->default_toolbar_width, win2->default_toolbar_width) &&
4723 EQ(win1->default_toolbar_height, win2->default_toolbar_height) &&
4724 EQ(win1->default_toolbar_visible_p, win2->default_toolbar_visible_p) &&
4725 EQ(win1->default_toolbar_border_width, win2->default_toolbar_border_width) &&
4726 #endif /* HAVE_TOOLBARS */
4727 EQ(win1->left_margin_width, win2->left_margin_width) &&
4728 EQ(win1->right_margin_width, win2->right_margin_width) &&
4729 EQ(win1->minimum_line_ascent, win2->minimum_line_ascent) &&
4730 EQ(win1->minimum_line_descent, win2->minimum_line_descent) &&
4731 EQ(win1->use_left_overflow, win2->use_left_overflow) &&
4732 EQ(win1->use_right_overflow, win2->use_right_overflow) &&
4733 #ifdef HAVE_MENUBARS
4734 EQ(win1->menubar_visible_p, win2->menubar_visible_p) &&
4735 #endif /* HAVE_MENUBARS */
4736 EQ(win1->text_cursor_visible_p, win2->text_cursor_visible_p);
4737 } 4669 }
4738 4670
4739 /* Returns a boolean indicating whether the two given configurations 4671 /* Returns a boolean indicating whether the two given configurations
4740 are identical. */ 4672 are identical. */
4741 static int 4673 static int
5009 WINDOW_TOP (w) = WINDOW_TOP (p); 4941 WINDOW_TOP (w) = WINDOW_TOP (p);
5010 WINDOW_WIDTH (w) = WINDOW_WIDTH (p); 4942 WINDOW_WIDTH (w) = WINDOW_WIDTH (p);
5011 WINDOW_HEIGHT (w) = WINDOW_HEIGHT (p); 4943 WINDOW_HEIGHT (w) = WINDOW_HEIGHT (p);
5012 w->hscroll = p->hscroll; 4944 w->hscroll = p->hscroll;
5013 w->modeline_hscroll = p->modeline_hscroll; 4945 w->modeline_hscroll = p->modeline_hscroll;
5014 w->display_table = p->display_table;
5015 w->modeline_shadow_thickness = p->modeline_shadow_thickness;
5016 w->has_modeline_p = p->has_modeline_p;
5017 #ifdef HAVE_SCROLLBARS
5018 w->scrollbar_width = p->scrollbar_width;
5019 w->scrollbar_height = p->scrollbar_height;
5020 w->horizontal_scrollbar_visible_p = p->horizontal_scrollbar_visible_p;
5021 w->vertical_scrollbar_visible_p = p->vertical_scrollbar_visible_p;
5022 w->scrollbar_on_left_p = p->scrollbar_on_left_p;
5023 w->scrollbar_on_top_p = p->scrollbar_on_top_p;
5024 w->scrollbar_pointer = p->scrollbar_pointer;
5025 #endif /* HAVE_SCROLLBARS */
5026 #ifdef HAVE_TOOLBARS
5027 {
5028 int ix;
5029 for (ix = 0; ix < 4; ix++)
5030 {
5031 w->toolbar[ix] = p->toolbar[ix];
5032 w->toolbar_size[ix] = p->toolbar_size[ix];
5033 w->toolbar_border_width[ix] = p->toolbar_border_width[ix];
5034 w->toolbar_visible_p[ix] = p->toolbar_visible_p[ix];
5035 }
5036 }
5037 w->toolbar_buttons_captioned_p = p->toolbar_buttons_captioned_p;
5038 w->default_toolbar = p->default_toolbar;
5039 w->default_toolbar_width = p->default_toolbar_width;
5040 w->default_toolbar_height = p->default_toolbar_height;
5041 w->default_toolbar_visible_p = p->default_toolbar_visible_p;
5042 w->default_toolbar_border_width = p->default_toolbar_border_width;
5043 #endif /* HAVE_TOOLBARS */
5044 w->left_margin_width = p->left_margin_width;
5045 w->right_margin_width = p->right_margin_width;
5046 w->minimum_line_ascent = p->minimum_line_ascent;
5047 w->minimum_line_descent = p->minimum_line_descent;
5048 w->use_left_overflow = p->use_left_overflow;
5049 w->use_right_overflow = p->use_right_overflow;
5050 #ifdef HAVE_MENUBARS
5051 w->menubar_visible_p = p->menubar_visible_p;
5052 #endif /* HAVE_MENUBARS */
5053 w->text_cursor_visible_p = p->text_cursor_visible_p;
5054 w->dedicated = p->dedicated;
5055 w->line_cache_last_updated = Qzero; 4946 w->line_cache_last_updated = Qzero;
5056 SET_LAST_MODIFIED (w, 1); 4947 SET_LAST_MODIFIED (w, 1);
5057 SET_LAST_FACECHANGE (w); 4948 SET_LAST_FACECHANGE (w);
5058 w->config_mark = 0; 4949 w->config_mark = 0;
4950
4951 #define WINDOW_SLOT(slot, compare) w->slot = p->slot;
4952 #include "winslots.h"
5059 4953
5060 /* Reinstall the saved buffer and pointers into it. */ 4954 /* Reinstall the saved buffer and pointers into it. */
5061 if (NILP (p->buffer)) 4955 if (NILP (p->buffer))
5062 w->buffer = p->buffer; 4956 w->buffer = p->buffer;
5063 else 4957 else
5275 WINDOW_TOP (p) = WINDOW_TOP (w); 5169 WINDOW_TOP (p) = WINDOW_TOP (w);
5276 WINDOW_WIDTH (p) = WINDOW_WIDTH (w); 5170 WINDOW_WIDTH (p) = WINDOW_WIDTH (w);
5277 WINDOW_HEIGHT (p) = WINDOW_HEIGHT (w); 5171 WINDOW_HEIGHT (p) = WINDOW_HEIGHT (w);
5278 p->hscroll = w->hscroll; 5172 p->hscroll = w->hscroll;
5279 p->modeline_hscroll = w->modeline_hscroll; 5173 p->modeline_hscroll = w->modeline_hscroll;
5280 p->display_table = w->display_table; 5174
5281 p->modeline_shadow_thickness = w->modeline_shadow_thickness; 5175 #define WINDOW_SLOT(slot, compare) p->slot = w->slot;
5282 p->has_modeline_p = w->has_modeline_p; 5176 #include "winslots.h"
5283 #ifdef HAVE_SCROLLBARS
5284 p->scrollbar_width = w->scrollbar_width;
5285 p->scrollbar_height = w->scrollbar_height;
5286 p->horizontal_scrollbar_visible_p = w->horizontal_scrollbar_visible_p;
5287 p->vertical_scrollbar_visible_p = w->vertical_scrollbar_visible_p;
5288 p->scrollbar_on_left_p = w->scrollbar_on_left_p;
5289 p->scrollbar_on_top_p = w->scrollbar_on_top_p;
5290 p->scrollbar_pointer = w->scrollbar_pointer;
5291 #endif /* HAVE_SCROLLBARS */
5292 #ifdef HAVE_TOOLBARS
5293 {
5294 int ix;
5295 for (ix = 0; ix < 4; ix++)
5296 {
5297 p->toolbar[ix] = w->toolbar[ix];
5298 p->toolbar_size[ix] = w->toolbar_size[ix];
5299 p->toolbar_border_width[ix] = w->toolbar_border_width[ix];
5300 p->toolbar_visible_p[ix] = w->toolbar_visible_p[ix];
5301 }
5302 }
5303 p->toolbar_buttons_captioned_p = w->toolbar_buttons_captioned_p;
5304 p->default_toolbar = w->default_toolbar;
5305 p->default_toolbar_width = w->default_toolbar_width;
5306 p->default_toolbar_height = w->default_toolbar_height;
5307 p->default_toolbar_visible_p = w->default_toolbar_visible_p;
5308 p->default_toolbar_border_width = w->default_toolbar_border_width;
5309 #endif /* HAVE_TOOLBARS */
5310 p->left_margin_width = w->left_margin_width;
5311 p->right_margin_width = w->right_margin_width;
5312 p->minimum_line_ascent = w->minimum_line_ascent;
5313 p->minimum_line_descent = w->minimum_line_descent;
5314 p->use_left_overflow = w->use_left_overflow;
5315 p->use_right_overflow = w->use_right_overflow;
5316 #ifdef HAVE_MENUBARS
5317 p->menubar_visible_p = w->menubar_visible_p;
5318 #endif /* HAVE_MENUBARS */
5319 p->text_cursor_visible_p = w->text_cursor_visible_p;
5320 5177
5321 if (!NILP (w->buffer)) 5178 if (!NILP (w->buffer))
5322 { 5179 {
5323 /* Save w's value of point in the window configuration. 5180 /* Save w's value of point in the window configuration.
5324 If w is the selected window, then get the value of point 5181 If w is the selected window, then get the value of point
5354 p->parent_index = saved_window_index (w->parent, config, i); 5211 p->parent_index = saved_window_index (w->parent, config, i);
5355 if (NILP (w->prev)) 5212 if (NILP (w->prev))
5356 p->prev_index = -1; 5213 p->prev_index = -1;
5357 else 5214 else
5358 p->prev_index = saved_window_index (w->prev, config, i); 5215 p->prev_index = saved_window_index (w->prev, config, i);
5359 p->dedicated = w->dedicated;
5360 if (!NILP (w->vchild)) 5216 if (!NILP (w->vchild))
5361 i = save_window_save (w->vchild, config, i); 5217 i = save_window_save (w->vchild, config, i);
5362 if (!NILP (w->hchild)) 5218 if (!NILP (w->hchild))
5363 i = save_window_save (w->hchild, config, i); 5219 i = save_window_save (w->hchild, config, i);
5364 } 5220 }
5672 set_specifier_caching (Vmodeline_shadow_thickness, 5528 set_specifier_caching (Vmodeline_shadow_thickness,
5673 slot_offset (struct window, 5529 slot_offset (struct window,
5674 modeline_shadow_thickness), 5530 modeline_shadow_thickness),
5675 modeline_shadow_thickness_changed, 5531 modeline_shadow_thickness_changed,
5676 0, 0); 5532 0, 0);
5677 5533
5678 DEFVAR_SPECIFIER ("has-modeline-p", &Vhas_modeline_p /* 5534 DEFVAR_SPECIFIER ("has-modeline-p", &Vhas_modeline_p /*
5679 *Whether the modeline should be displayed. 5535 *Whether the modeline should be displayed.
5680 This is a specifier; use `set-specifier' to change it. 5536 This is a specifier; use `set-specifier' to change it.
5681 */ ); 5537 */ );
5682 Vhas_modeline_p = Fmake_specifier (Qboolean); 5538 Vhas_modeline_p = Fmake_specifier (Qboolean);
5689 flag to indicate that the shadow-thickness 5545 flag to indicate that the shadow-thickness
5690 has changed, but not one to indicate that 5546 has changed, but not one to indicate that
5691 the modeline has been turned off or on. */ 5547 the modeline has been turned off or on. */
5692 some_window_value_changed, 5548 some_window_value_changed,
5693 0, 0); 5549 0, 0);
5694 } 5550
5551 DEFVAR_SPECIFIER ("vertical-divider-draggable-p", &Vvertical_divider_draggable_p /*
5552 *Should XEmacs allow resizing windows by dragging vertical dividers.
5553 When t, vertical dividers are always shown, and are draggable.
5554 When nil, vertical dividers are shown only when there are no scrollbars
5555 in between windows, and not draggable.
5556 This is a specifier; use `set-specifier' to change it.
5557 */ );
5558 Vvertical_divider_draggable_p = Fmake_specifier (Qboolean);
5559 set_specifier_fallback (Vvertical_divider_draggable_p,
5560 list1 (Fcons (Qnil, Qt)));
5561 set_specifier_caching (Vvertical_divider_draggable_p,
5562 slot_offset (struct window,
5563 vertical_divider_draggable_p),
5564 vertical_divider_changed_in_window,
5565 0, 0);
5566
5567 DEFVAR_SPECIFIER ("vertical-divider-shadow-thickness", &Vvertical_divider_shadow_thickness /*
5568 *How thick to draw shadows around the vertical dividers.
5569 This is a specifier; use `set-specifier' to change it.
5570 */ );
5571 Vvertical_divider_shadow_thickness = Fmake_specifier (Qinteger);
5572 set_specifier_fallback (Vvertical_divider_shadow_thickness,
5573 list1 (Fcons (Qnil, Qzero)));
5574 Fadd_spec_to_specifier (Vvertical_divider_shadow_thickness, make_int (2),
5575 Qnil, Qnil, Qnil);
5576 set_specifier_caching (Vvertical_divider_shadow_thickness,
5577 slot_offset (struct window,
5578 vertical_divider_shadow_thickness),
5579 vertical_divider_changed_in_window,
5580 0, 0);
5581 DEFVAR_SPECIFIER ("vertical-divider-line-width", &Vvertical_divider_line_width /*
5582 *The width of the vertical dividers, not including shadows.
5583
5584 For TTY windows, divider line is always one character wide. When
5585 instance of this specifier is zero in a TTY window, no divider is
5586 drawn at all between windows. When non-zero, one character wide
5587 divider is displayed.
5588
5589 *Whether the modeline should be displayed.
5590 This is a specifier; use `set-specifier' to change it.
5591 */ );
5592
5593 Vvertical_divider_line_width = Fmake_specifier (Qnatnum);
5594 {
5595 Lisp_Object fb = Qnil;
5596 #ifdef HAVE_TTY
5597 fb = Fcons (Fcons (list1 (Qtty), Qzero), fb);
5598 #endif
5599 #ifdef HAVE_X_WINDOWS
5600 fb = Fcons (Fcons (list1 (Qx), make_int (3)), fb);
5601 #endif
5602 #ifdef HAVE_MS_WINDOWS
5603 /* #### This should be made magic and made to obey system settings */
5604 fb = Fcons (Fcons (list1 (Qmswindows), make_int (3)), fb);
5605 #endif
5606 set_specifier_fallback (Vvertical_divider_line_width, fb);
5607 }
5608 set_specifier_caching (Vvertical_divider_line_width,
5609 slot_offset (struct window,
5610 vertical_divider_line_width),
5611 vertical_divider_changed_in_window,
5612 0, 0);
5613
5614 DEFVAR_SPECIFIER ("vertical-divider-spacing", &Vvertical_divider_spacing /*
5615 *How much space to leave around the vertical dividers.
5616
5617 In TTY windows, spacing is always zero, and the value of this
5618 specifier is ignored.
5619
5620 This is a specifier; use `set-specifier' to change it.
5621 */ );
5622 Vvertical_divider_spacing = Fmake_specifier (Qnatnum);
5623 {
5624 Lisp_Object fb = Qnil;
5625 #ifdef HAVE_TTY
5626 fb = Fcons (Fcons (list1 (Qtty), Qzero), fb);
5627 #endif
5628 #ifdef HAVE_X_WINDOWS
5629 /* #### 3D dividers look great on MS Windows with spacing = 0.
5630 Shoud not the same value be the fallback under X? - kkm */
5631 fb = Fcons (Fcons (list1 (Qx), make_int (2)), fb);
5632 #endif
5633 #ifdef HAVE_MS_WINDOWS
5634 fb = Fcons (Fcons (list1 (Qmswindows), Qzero), fb);
5635 #endif
5636 set_specifier_fallback (Vvertical_divider_spacing, fb);
5637 }
5638 set_specifier_caching (Vvertical_divider_spacing,
5639 slot_offset (struct window,
5640 vertical_divider_spacing),
5641 vertical_divider_changed_in_window,
5642 0, 0);
5643 }