Index: src/frame-x.c =================================================================== RCS file: /usr/CVSroot/XEmacs/xemacs/src/frame-x.c,v retrieving revision 1.41.2.14 diff -u -r1.41.2.14 frame-x.c --- src/frame-x.c 2000/02/16 02:07:05 1.41.2.14 +++ src/frame-x.c 2000/03/01 17:31:31 @@ -50,6 +50,7 @@ #include "faces.h" #include "frame.h" #include "window.h" +#include "gutter.h" #ifdef HAVE_DRAGNDROP #include "dragdrop.h" @@ -1550,13 +1551,16 @@ { struct window *win = XWINDOW (f->root_window); - WINDOW_LEFT (win) = FRAME_LEFT_BORDER_END (f); - WINDOW_TOP (win) = FRAME_TOP_BORDER_END (f); + WINDOW_LEFT (win) = FRAME_LEFT_BORDER_END (f) + + FRAME_LEFT_GUTTER_BOUNDS (f); + WINDOW_TOP (win) = FRAME_TOP_BORDER_END (f) + + FRAME_TOP_GUTTER_BOUNDS (f); if (!NILP (f->minibuffer_window)) { win = XWINDOW (f->minibuffer_window); - WINDOW_LEFT (win) = FRAME_LEFT_BORDER_END (f); + WINDOW_LEFT (win) = FRAME_LEFT_BORDER_END (f) + + FRAME_LEFT_GUTTER_BOUNDS (f); } } Index: src/frame.c =================================================================== RCS file: /usr/CVSroot/XEmacs/xemacs/src/frame.c,v retrieving revision 1.37.2.24 diff -u -r1.37.2.24 frame.c --- src/frame.c 2000/02/21 23:06:57 1.37.2.24 +++ src/frame.c 2000/03/01 17:31:39 @@ -2864,6 +2864,9 @@ - FRAME_REAL_BOTTOM_TOOLBAR_HEIGHT (f) - 2 * FRAME_REAL_BOTTOM_TOOLBAR_BORDER_WIDTH (f); + new_pixheight -= + (FRAME_TOP_GUTTER_BOUNDS (f) + FRAME_BOTTOM_GUTTER_BOUNDS (f)); + new_pixwidth += + FRAME_THEORETICAL_LEFT_TOOLBAR_WIDTH (f) + 2 * FRAME_THEORETICAL_LEFT_TOOLBAR_BORDER_WIDTH (f) @@ -2876,6 +2879,9 @@ - FRAME_REAL_RIGHT_TOOLBAR_WIDTH (f) - 2 * FRAME_REAL_RIGHT_TOOLBAR_BORDER_WIDTH (f); + new_pixwidth -= + (FRAME_LEFT_GUTTER_BOUNDS (f) + FRAME_RIGHT_GUTTER_BOUNDS (f)); + /* Adjust the width for the end glyph which may be a different width than the default character width. */ { @@ -2897,7 +2903,8 @@ if (new_pixheight) { - XWINDOW (FRAME_ROOT_WINDOW (f))->pixel_top = FRAME_TOP_BORDER_END (f); + XWINDOW (FRAME_ROOT_WINDOW (f))->pixel_top + = FRAME_TOP_BORDER_END (f) + FRAME_TOP_GUTTER_BOUNDS (f); if (FRAME_HAS_MINIBUF_P (f) && ! FRAME_MINIBUF_ONLY_P (f)) @@ -2923,7 +2930,10 @@ new_pixheight - minibuf_height, 0); XWINDOW (FRAME_MINIBUF_WINDOW (f))->pixel_top = - new_pixheight - minibuf_height + FRAME_TOP_BORDER_END (f); + FRAME_TOP_BORDER_END (f) + + FRAME_TOP_GUTTER_BOUNDS (f) + + FRAME_BOTTOM_GUTTER_BOUNDS (f) + + new_pixheight - minibuf_height; set_window_pixheight (FRAME_MINIBUF_WINDOW (f), minibuf_height, 0); } @@ -2938,13 +2948,14 @@ if (new_pixwidth) { - XWINDOW (FRAME_ROOT_WINDOW (f))->pixel_left = FRAME_LEFT_BORDER_END (f); + XWINDOW (FRAME_ROOT_WINDOW (f))->pixel_left = + FRAME_LEFT_BORDER_END (f) + FRAME_LEFT_GUTTER_BOUNDS (f); set_window_pixwidth (FRAME_ROOT_WINDOW (f), new_pixwidth, 0); if (FRAME_HAS_MINIBUF_P (f)) { XWINDOW (FRAME_MINIBUF_WINDOW (f))->pixel_left = - FRAME_LEFT_BORDER_END (f); + FRAME_LEFT_BORDER_END (f) + FRAME_LEFT_GUTTER_BOUNDS (f); set_window_pixwidth (FRAME_MINIBUF_WINDOW (f), new_pixwidth, 0); } Index: src/frame.h =================================================================== RCS file: /usr/CVSroot/XEmacs/xemacs/src/frame.h,v retrieving revision 1.18.2.12 diff -u -r1.18.2.12 frame.h --- src/frame.h 2000/02/26 11:39:47 1.18.2.12 +++ src/frame.h 2000/03/01 17:31:41 @@ -115,6 +115,7 @@ in redisplay_frame. */ unsigned int current_toolbar_size[4]; #endif + unsigned int current_gutter_bounds[4]; /* Dynamic array of display lines for gutters */ display_line_dynarr *current_display_lines; Index: src/glyphs-msw.c =================================================================== RCS file: /usr/CVSroot/XEmacs/xemacs/src/glyphs-msw.c,v retrieving revision 1.21.2.48 diff -u -r1.21.2.48 glyphs-msw.c --- src/glyphs-msw.c 2000/02/26 11:39:52 1.21.2.48 +++ src/glyphs-msw.c 2000/03/01 17:31:47 @@ -2223,7 +2223,6 @@ { Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); Lisp_Object device = IMAGE_INSTANCE_DEVICE (ii); - struct device* d = XDEVICE (device); Lisp_Object frame = FW_FRAME (domain); HWND wnd; @@ -2346,7 +2345,6 @@ /* this function can call lisp */ Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance); Lisp_Object device = IMAGE_INSTANCE_DEVICE (ii), style; - struct device* d = XDEVICE (device); Lisp_Object frame = FW_FRAME (domain); Extbyte* nm=0; HWND wnd; Index: src/gutter.c =================================================================== RCS file: /usr/CVSroot/XEmacs/xemacs/src/Attic/gutter.c,v retrieving revision 1.1.2.21 diff -u -r1.1.2.21 gutter.c --- src/gutter.c 2000/02/27 21:23:05 1.1.2.21 +++ src/gutter.c 2000/03/01 17:31:50 @@ -169,7 +169,6 @@ int *width, int *height) { struct window - * top = XWINDOW (frame_topmost_window (f)), * bot = XWINDOW (frame_bottommost_window (f)); /* The top and bottom gutters take precedence over the left and right. */ @@ -185,8 +184,7 @@ case BOTTOM_GUTTER: *x = FRAME_LEFT_BORDER_END (f); - *y = WINDOW_BOTTOM (bot) - - FRAME_BOTTOM_GUTTER_BOUNDS (f); + *y = WINDOW_BOTTOM (bot); *width = FRAME_RIGHT_BORDER_START (f) - FRAME_LEFT_BORDER_END (f); *height = FRAME_BOTTOM_GUTTER_BOUNDS (f); @@ -194,21 +192,19 @@ case LEFT_GUTTER: *x = FRAME_LEFT_BORDER_END (f); - *y = WINDOW_TEXT_TOP (top); + *y = FRAME_TOP_BORDER_END (f) + FRAME_TOP_GUTTER_BOUNDS (f); *width = FRAME_LEFT_GUTTER_BOUNDS (f); *height = WINDOW_BOTTOM (bot) - - (WINDOW_TEXT_TOP (top) - + FRAME_BOTTOM_GUTTER_BOUNDS (f)); + - (FRAME_TOP_BORDER_END (f) + FRAME_TOP_GUTTER_BOUNDS (f)); break; case RIGHT_GUTTER: *x = FRAME_RIGHT_BORDER_START (f) - FRAME_RIGHT_GUTTER_BOUNDS (f); - *y = WINDOW_TEXT_TOP (top); + *y = FRAME_TOP_BORDER_END (f) + FRAME_TOP_GUTTER_BOUNDS (f); *width = FRAME_RIGHT_GUTTER_BOUNDS (f); *height = WINDOW_BOTTOM (bot) - - (WINDOW_TEXT_TOP (top) - + FRAME_BOTTOM_GUTTER_BOUNDS (f)); + - (FRAME_TOP_BORDER_END (f) + FRAME_TOP_GUTTER_BOUNDS (f)); break; default: @@ -400,6 +396,26 @@ so locally disable them. */ int local_clip_changed = f->clip_changed; int local_buffers_changed = f->buffers_changed; + + /* If the gutter geometry has changed then re-layout the + frame. */ + GUTTER_POS_LOOP (pos) + { + if (FRAME_GUTTER_BOUNDS (f, pos) != f->current_gutter_bounds[pos]) + { + int width, height; + pixel_to_char_size (f, FRAME_PIXWIDTH (f), FRAME_PIXHEIGHT (f), + &width, &height); + change_frame_size (f, height, width, 0); + break; + } + } + + GUTTER_POS_LOOP (pos) + { + f->current_gutter_bounds[pos] = FRAME_GUTTER_BOUNDS (f, pos); + } + f->clip_changed = 0; f->buffers_changed = 0; @@ -849,6 +865,12 @@ MARK_GUTTER_CHANGED; MARK_WINDOWS_CHANGED (w); } + } + + /* Keep a record of the current sizes of things. */ + GUTTER_POS_LOOP (pos) + { + f->current_gutter_bounds[pos] = FRAME_GUTTER_BOUNDS (f, pos); } } Index: src/gutter.h =================================================================== RCS file: /usr/CVSroot/XEmacs/xemacs/src/Attic/gutter.h,v retrieving revision 1.1.2.9 diff -u -r1.1.2.9 gutter.h --- src/gutter.h 2000/02/26 21:26:11 1.1.2.9 +++ src/gutter.h 2000/03/01 17:31:50 @@ -93,17 +93,13 @@ /* these macros predicate size on position and type of window */ #define WINDOW_REAL_TOP_GUTTER_BOUNDS(w) \ - ((!MINI_WINDOW_P (w) && window_is_highest (w)) ? \ - WINDOW_REAL_GUTTER_BOUNDS (w,TOP_GUTTER) : 0) + WINDOW_REAL_GUTTER_BOUNDS (w,TOP_GUTTER) #define WINDOW_REAL_BOTTOM_GUTTER_BOUNDS(w) \ - ((!MINI_WINDOW_P (w) && window_is_lowest (w)) ? \ - WINDOW_REAL_GUTTER_BOUNDS (w,BOTTOM_GUTTER) : 0) + WINDOW_REAL_GUTTER_BOUNDS (w,BOTTOM_GUTTER) #define WINDOW_REAL_LEFT_GUTTER_BOUNDS(w) \ - ((!MINI_WINDOW_P (w) && window_is_leftmost (w)) ? \ - WINDOW_REAL_GUTTER_BOUNDS (w,LEFT_GUTTER) : 0) + WINDOW_REAL_GUTTER_BOUNDS (w,LEFT_GUTTER) #define WINDOW_REAL_RIGHT_GUTTER_BOUNDS(w) \ - ((!MINI_WINDOW_P (w) && window_is_rightmost (w)) ? \ - WINDOW_REAL_GUTTER_BOUNDS (w,RIGHT_GUTTER) : 0) + WINDOW_REAL_GUTTER_BOUNDS (w,RIGHT_GUTTER) #define FRAME_GUTTER_VISIBLE(f, pos) \ WINDOW_REAL_GUTTER_VISIBLE (XWINDOW (FRAME_LAST_NONMINIBUF_WINDOW (f)), pos) Index: src/redisplay-msw.c =================================================================== RCS file: /usr/CVSroot/XEmacs/xemacs/src/redisplay-msw.c,v retrieving revision 1.28.2.20 diff -u -r1.28.2.20 redisplay-msw.c --- src/redisplay-msw.c 2000/02/24 02:32:58 1.28.2.20 +++ src/redisplay-msw.c 2000/03/01 17:31:53 @@ -1235,8 +1235,8 @@ int abs_shadow = abs (shadow); int line_width = XINT (w->vertical_divider_line_width); int div_left = WINDOW_RIGHT (w) - window_divider_width (w); - int y1 = WINDOW_TOP (w) + FRAME_TOP_GUTTER_BOUNDS (f); - int y2 = WINDOW_BOTTOM (w) + FRAME_BOTTOM_GUTTER_BOUNDS (f); + int y1 = WINDOW_TOP (w); + int y2 = WINDOW_BOTTOM (w); /* Clear left and right spacing areas */ if (spacing) Index: src/redisplay-x.c =================================================================== RCS file: /usr/CVSroot/XEmacs/xemacs/src/redisplay-x.c,v retrieving revision 1.23.2.19 diff -u -r1.23.2.19 redisplay-x.c --- src/redisplay-x.c 2000/02/16 02:07:13 1.23.2.19 +++ src/redisplay-x.c 2000/03/01 17:31:57 @@ -1320,8 +1320,8 @@ spacing = XINT (w->vertical_divider_spacing); line_width = XINT (w->vertical_divider_line_width); x = WINDOW_RIGHT (w) - width; - y1 = WINDOW_TOP (w) + FRAME_TOP_GUTTER_BOUNDS (f); - y2 = WINDOW_BOTTOM (w) + FRAME_BOTTOM_GUTTER_BOUNDS (f); + y1 = WINDOW_TOP (w); + y2 = WINDOW_BOTTOM (w); memset (&gcv, ~0, sizeof (XGCValues)); Index: src/redisplay.c =================================================================== RCS file: /usr/CVSroot/XEmacs/xemacs/src/redisplay.c,v retrieving revision 1.55.2.41 diff -u -r1.55.2.41 redisplay.c --- src/redisplay.c 2000/02/17 14:16:46 1.55.2.41 +++ src/redisplay.c 2000/03/01 17:32:17 @@ -3632,10 +3632,6 @@ /* The modeline is at the bottom of the gutters. */ dl->ypos = WINDOW_BOTTOM (w); - /* adjust for the bottom gutter */ - if (window_is_lowest (w)) - dl->ypos -= FRAME_BOTTOM_GUTTER_BOUNDS (f); - rb.findex = MODELINE_INDEX; rb.xpos = dl->bounds.left_out; rb.width = dl->bounds.right_out - dl->bounds.left_out; @@ -3689,9 +3685,6 @@ set this until we've generated the modeline in order to account for any embedded faces. */ dl->ypos = WINDOW_BOTTOM (w) - dl->descent - ypos_adj; - /* adjust for the bottom gutter */ - if (window_is_lowest (w)) - dl->ypos -= FRAME_BOTTOM_GUTTER_BOUNDS (f); } static Charcount @@ -6346,16 +6339,16 @@ if (f->clear) f->frame_changed = 1; - /* invalidate the subwindow cache. We use subwindows_changed here to + /* Invalidate the subwindow cache. We use subwindows_changed here to cause subwindows to get instantiated. This is because subwindows_state_changed is less strict - dealing with things like the clicked state of button. We have to do this before redisplaying the gutters as subwindows get unmapped in the process.*/ - if (!Dynarr_length (f->subwindow_cachels) - || f->subwindows_changed - || f->faces_changed - || f->frame_changed) + if (/* !Dynarr_length (f->subwindow_cachels) + || f->subwindows_changed + || f->faces_changed + || */ f->frame_changed) { reset_subwindow_cachels (f); /* we have to do this so the gutter gets regenerated. */ Index: src/scrollbar.c =================================================================== RCS file: /usr/CVSroot/XEmacs/xemacs/src/scrollbar.c,v retrieving revision 1.17.2.4 diff -u -r1.17.2.4 scrollbar.c --- src/scrollbar.c 2000/01/26 12:34:01 1.17.2.4 +++ src/scrollbar.c 2000/03/01 17:32:18 @@ -460,14 +460,10 @@ if (!NILP (w->scrollbar_on_left_p)) { x_offset = WINDOW_LEFT (w); - if (window_is_leftmost (w)) - x_offset += FRAME_LEFT_GUTTER_BOUNDS (f); } else { x_offset = WINDOW_RIGHT (w) - scrollbar_width; - if (window_is_rightmost (w)) - x_offset -= FRAME_RIGHT_GUTTER_BOUNDS (f); if (window_needs_vertical_divider (w)) x_offset -= window_divider_width (w); } @@ -481,8 +477,6 @@ if (!NILP (w->scrollbar_on_top_p)) { y_offset += WINDOW_TOP (w); - if (window_is_highest (w)) - y_offset += FRAME_TOP_GUTTER_BOUNDS (f); } else { Index: src/window.c =================================================================== RCS file: /usr/CVSroot/XEmacs/xemacs/src/window.c,v retrieving revision 1.41.2.40 diff -u -r1.41.2.40 window.c --- src/window.c 2000/02/25 12:51:04 1.41.2.40 +++ src/window.c 2000/03/01 17:32:31 @@ -1011,15 +1011,6 @@ ****************************************************************************/ static int -window_top_frame_gutter_height (struct window *w) -{ - if (!NILP (w->hchild) || !NILP (w->vchild)) - return 0; - else - return WINDOW_REAL_TOP_GUTTER_BOUNDS (w); -} - -static int window_top_window_gutter_height (struct window *w) { if (!NILP (w->hchild) || !NILP (w->vchild)) @@ -1036,20 +1027,10 @@ int window_top_gutter_height (struct window *w) { - return window_top_window_gutter_height (w) - + window_top_frame_gutter_height (w); + return window_top_window_gutter_height (w); } static int -window_bottom_frame_gutter_height (struct window *w) -{ - if (!NILP (w->hchild) || !NILP (w->vchild)) - return 0; - else - return WINDOW_REAL_BOTTOM_GUTTER_BOUNDS (w); -} - -static int window_bottom_window_gutter_height (struct window *w) { int gutter; @@ -1070,8 +1051,7 @@ int window_bottom_gutter_height (struct window *w) { - return window_bottom_window_gutter_height (w) - + window_bottom_frame_gutter_height (w); + return window_bottom_window_gutter_height (w); } static int @@ -1088,20 +1068,10 @@ return 0; } -static int -window_left_frame_gutter_width (struct window *w) -{ - if (!NILP (w->hchild) || !NILP (w->vchild)) - return 0; - else - return WINDOW_REAL_LEFT_GUTTER_BOUNDS (w); -} - int window_left_gutter_width (struct window *w, int modeline) { - return window_left_window_gutter_width (w, modeline) - + window_left_frame_gutter_width (w); + return window_left_window_gutter_width (w, modeline); } static int @@ -1123,28 +1093,16 @@ return gutter; } -static int -window_right_frame_gutter_width (struct window *w) -{ - if (!NILP (w->hchild) || !NILP (w->vchild)) - return 0; - else - return WINDOW_REAL_RIGHT_GUTTER_BOUNDS (w); -} - int window_right_gutter_width (struct window *w, int modeline) { - return window_right_window_gutter_width (w, modeline) - + window_right_frame_gutter_width (w); + return window_right_window_gutter_width (w, modeline); } static int window_pixel_height (struct window* w) { - return WINDOW_HEIGHT (w) - - (window_top_frame_gutter_height (w) - + window_bottom_frame_gutter_height (w)); + return WINDOW_HEIGHT (w); } @@ -1594,15 +1552,14 @@ DEFUN ("window-pixel-edges", Fwindow_pixel_edges, 0, 1, 0, /* Return a list of the pixel edge coordinates of WINDOW. \(LEFT TOP RIGHT BOTTOM), all relative to 0, 0 at top left corner of frame. -The frame toolbars and menubars are considered to be outside of this area. +The frame toolbars, menubars and gutters are considered to be outside of this area. */ (window)) { struct window *w = decode_window (window); - struct frame *f = XFRAME (w->frame); - int left = w->pixel_left - FRAME_LEFT_BORDER_END (f); - int top = w->pixel_top - FRAME_TOP_BORDER_END (f); + int left = w->pixel_left; + int top = w->pixel_top; return list4 (make_int (left), make_int (top), @@ -3532,11 +3489,9 @@ CHECK_INT (chsize); size = XINT (chsize); if (!NILP (horflag)) - psize = window_char_width_to_pixel_width (o, size, 0) - + window_left_frame_gutter_width (o); + psize = window_char_width_to_pixel_width (o, size, 0); else - psize = window_char_height_to_pixel_height (o, size, 1) - + window_top_frame_gutter_height (o); + psize = window_char_height_to_pixel_height (o, size, 1); } if (MINI_WINDOW_P (o))