Mercurial > hg > xemacs-beta
comparison src/window.c @ 422:95016f13131a r21-2-19
Import from CVS: tag r21-2-19
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:25:01 +0200 |
parents | 41dbb7a9d5f2 |
children | 11054d720c21 |
comparison
equal
deleted
inserted
replaced
421:fff06e11db74 | 422:95016f13131a |
---|---|
36 #include "glyphs.h" | 36 #include "glyphs.h" |
37 #include "redisplay.h" | 37 #include "redisplay.h" |
38 #include "window.h" | 38 #include "window.h" |
39 #include "elhash.h" | 39 #include "elhash.h" |
40 #include "commands.h" | 40 #include "commands.h" |
41 #include "gutter.h" | |
41 | 42 |
42 Lisp_Object Qwindowp, Qwindow_live_p, Qwindow_configurationp; | 43 Lisp_Object Qwindowp, Qwindow_live_p, Qwindow_configurationp; |
43 Lisp_Object Qscroll_up, Qscroll_down, Qdisplay_buffer; | 44 Lisp_Object Qscroll_up, Qscroll_down, Qdisplay_buffer; |
44 | 45 |
45 #ifdef MEMORY_USAGE_STATS | 46 #ifdef MEMORY_USAGE_STATS |
639 window_full_width_p (struct window *w) | 640 window_full_width_p (struct window *w) |
640 { | 641 { |
641 return window_is_leftmost (w) && window_is_rightmost (w); | 642 return window_is_leftmost (w) && window_is_rightmost (w); |
642 } | 643 } |
643 | 644 |
644 static int | 645 int |
645 window_is_highest (struct window *w) | 646 window_is_highest (struct window *w) |
646 { | 647 { |
647 Lisp_Object parent, current_ancestor, window; | 648 Lisp_Object parent, current_ancestor, window; |
648 | 649 |
649 XSETWINDOW (window, w); | 650 XSETWINDOW (window, w); |
667 return 1; | 668 return 1; |
668 else | 669 else |
669 return 0; | 670 return 0; |
670 } | 671 } |
671 | 672 |
672 static int | 673 int |
673 window_is_lowest (struct window *w) | 674 window_is_lowest (struct window *w) |
674 { | 675 { |
675 Lisp_Object parent, current_ancestor, window; | 676 Lisp_Object parent, current_ancestor, window; |
676 | 677 |
677 XSETWINDOW (window, w); | 678 XSETWINDOW (window, w); |
970 window_right_margin_width (struct window *w) | 971 window_right_margin_width (struct window *w) |
971 { | 972 { |
972 return margin_width_internal (w, 0); | 973 return margin_width_internal (w, 0); |
973 } | 974 } |
974 | 975 |
975 static int | |
976 window_top_toolbar_height (struct window *w) | |
977 { | |
978 /* #### implement this shit. */ | |
979 return 0; | |
980 } | |
981 | |
982 /* #### Currently used in scrollbar.c. Does it actually need to be? */ | |
983 int | |
984 window_bottom_toolbar_height (struct window *w) | |
985 { | |
986 return 0; | |
987 } | |
988 | |
989 static int | |
990 window_left_toolbar_width (struct window *w) | |
991 { | |
992 return 0; | |
993 } | |
994 | |
995 static int | |
996 window_right_toolbar_width (struct window *w) | |
997 { | |
998 return 0; | |
999 } | |
1000 | |
1001 /***************************************************************************** | 976 /***************************************************************************** |
1002 Window Gutters | 977 Window Gutters |
1003 | 978 |
1004 The gutters of a window are those areas in the boundary defined by | 979 The gutters of a window are those areas in the boundary defined by |
1005 w->pixel_top, w->pixel_left, w->pixel_height and w->pixel_width which | 980 w->pixel_top, w->pixel_left, w->pixel_height and w->pixel_width which |
1017 ****************************************************************************/ | 992 ****************************************************************************/ |
1018 | 993 |
1019 int | 994 int |
1020 window_top_gutter_height (struct window *w) | 995 window_top_gutter_height (struct window *w) |
1021 { | 996 { |
1022 int toolbar_height = window_top_toolbar_height (w); | 997 int gutter = WINDOW_REAL_TOP_GUTTER_BOUNDS (w); |
1023 | 998 |
1024 if (!NILP (w->hchild) || !NILP (w->vchild)) | 999 if (!NILP (w->hchild) || !NILP (w->vchild)) |
1025 return 0; | 1000 return 0; |
1026 | 1001 |
1027 #ifdef HAVE_SCROLLBARS | 1002 #ifdef HAVE_SCROLLBARS |
1028 if (!NILP (w->scrollbar_on_top_p)) | 1003 if (!NILP (w->scrollbar_on_top_p)) |
1029 return window_scrollbar_height (w) + toolbar_height; | 1004 return window_scrollbar_height (w) + gutter; |
1030 else | 1005 else |
1031 #endif | 1006 #endif |
1032 return toolbar_height; | 1007 return gutter; |
1033 } | 1008 } |
1034 | 1009 |
1035 int | 1010 int |
1036 window_bottom_gutter_height (struct window *w) | 1011 window_bottom_gutter_height (struct window *w) |
1037 { | 1012 { |
1038 int other_height; | 1013 int gutter = WINDOW_REAL_BOTTOM_GUTTER_BOUNDS (w); |
1039 | 1014 |
1040 if (!NILP (w->hchild) || !NILP (w->vchild)) | 1015 if (!NILP (w->hchild) || !NILP (w->vchild)) |
1041 return 0; | 1016 return 0; |
1042 else | 1017 |
1043 other_height = | 1018 gutter += window_modeline_height (w); |
1044 window_modeline_height (w) + window_bottom_toolbar_height (w); | |
1045 | 1019 |
1046 #ifdef HAVE_SCROLLBARS | 1020 #ifdef HAVE_SCROLLBARS |
1047 if (NILP (w->scrollbar_on_top_p)) | 1021 if (NILP (w->scrollbar_on_top_p)) |
1048 return window_scrollbar_height (w) + other_height; | 1022 return window_scrollbar_height (w) + gutter; |
1049 else | 1023 else |
1050 #endif | 1024 #endif |
1051 return other_height; | 1025 return gutter; |
1052 } | 1026 } |
1053 | 1027 |
1054 int | 1028 int |
1055 window_left_gutter_width (struct window *w, int modeline) | 1029 window_left_gutter_width (struct window *w, int modeline) |
1056 { | 1030 { |
1057 int gutter = window_left_toolbar_width (w); | 1031 int gutter = WINDOW_REAL_LEFT_GUTTER_BOUNDS (w); |
1058 | 1032 |
1059 if (!NILP (w->hchild) || !NILP (w->vchild)) | 1033 if (!NILP (w->hchild) || !NILP (w->vchild)) |
1060 return 0; | 1034 return 0; |
1061 | |
1062 | 1035 |
1063 #ifdef HAVE_SCROLLBARS | 1036 #ifdef HAVE_SCROLLBARS |
1064 if (!modeline && !NILP (w->scrollbar_on_left_p)) | 1037 if (!modeline && !NILP (w->scrollbar_on_left_p)) |
1065 gutter += window_scrollbar_width (w); | 1038 gutter += window_scrollbar_width (w); |
1066 #endif | 1039 #endif |
1069 } | 1042 } |
1070 | 1043 |
1071 int | 1044 int |
1072 window_right_gutter_width (struct window *w, int modeline) | 1045 window_right_gutter_width (struct window *w, int modeline) |
1073 { | 1046 { |
1074 int gutter = window_right_toolbar_width (w); | 1047 int gutter = WINDOW_REAL_RIGHT_GUTTER_BOUNDS (w); |
1075 | 1048 |
1076 if (!NILP (w->hchild) || !NILP (w->vchild)) | 1049 if (!NILP (w->hchild) || !NILP (w->vchild)) |
1077 return 0; | 1050 return 0; |
1078 | 1051 |
1079 #ifdef HAVE_SCROLLBARS | 1052 #ifdef HAVE_SCROLLBARS |
3924 } | 3897 } |
3925 | 3898 |
3926 SET_LAST_MODIFIED (w, 0); | 3899 SET_LAST_MODIFIED (w, 0); |
3927 SET_LAST_FACECHANGE (w); | 3900 SET_LAST_FACECHANGE (w); |
3928 MARK_FRAME_WINDOWS_STRUCTURE_CHANGED (f); | 3901 MARK_FRAME_WINDOWS_STRUCTURE_CHANGED (f); |
3902 /* overkill maybe, but better to be correct */ | |
3903 MARK_FRAME_GUTTERS_CHANGED (f); | |
3929 } | 3904 } |
3930 #undef MINSIZE | 3905 #undef MINSIZE |
3931 #undef CURBEG | 3906 #undef CURBEG |
3932 #undef CURSIZE | 3907 #undef CURSIZE |
3933 #undef CURCHARSIZE | 3908 #undef CURCHARSIZE |