comparison src/redisplay-output.c @ 5090:0ca81354c4c7

Further frame-geometry cleanups -------------------- ChangeLog entries follow: -------------------- man/ChangeLog addition: 2010-03-03 Ben Wing <ben@xemacs.org> * internals/internals.texi (Intro to Window and Frame Geometry): * internals/internals.texi (The Paned Area): * internals/internals.texi (The Displayable Area): Update to make note of e.g. the fact that the bottom gutter is actually above the minibuffer. src/ChangeLog addition: 2010-03-03 Ben Wing <ben@xemacs.org> * emacs.c: * emacs.c (assert_equal_failed): * lisp.h: * lisp.h (assert_equal): New fun assert_equal, asserting that two values == each other, and printing out both values upon failure. * frame-gtk.c (gtk_initialize_frame_size): * frame-impl.h: * frame-impl.h (FRAME_TOP_INTERNAL_BORDER_START): * frame-impl.h (FRAME_BOTTOM_INTERNAL_BORDER_START): * frame-impl.h (FRAME_LEFT_INTERNAL_BORDER_START): * frame-impl.h (FRAME_PANED_TOP_EDGE): * frame-impl.h (FRAME_NONPANED_SIZE): * frame-x.c (x_initialize_frame_size): * frame.c: * gutter.c (get_gutter_coords): * gutter.c (calculate_gutter_size): * gutter.h: * gutter.h (WINDOW_REAL_TOP_GUTTER_BOUNDS): * gutter.h (FRAME_TOP_GUTTER_BOUNDS): * input-method-xlib.c: * input-method-xlib.c (XIM_SetGeometry): * redisplay-output.c (clear_left_border): * redisplay-output.c (clear_right_border): * redisplay-output.c (redisplay_output_pixmap): * redisplay-output.c (redisplay_clear_region): * redisplay-output.c (redisplay_clear_top_of_window): * redisplay-output.c (redisplay_clear_to_window_end): * redisplay-xlike-inc.c (XLIKE_clear_frame): * redisplay.c: * redisplay.c (UPDATE_CACHE_RETURN): * redisplay.c (pixel_to_glyph_translation): * toolbar.c (update_frame_toolbars_geometry): * window.c (Fwindow_pixel_edges): Get rid of some redundant macros. Consistently use the FRAME_TOP_*_START, FRAME_RIGHT_*_END, etc. format. Rename FRAME_*_BORDER_* to FRAME_*_INTERNAL_BORDER_*. Comment out FRAME_BOTTOM_* for gutters and the paned area due to the uncertainty over where the paned area actually begins. (Eventually we should probably move the gutters outside the minibuffer so that the paned area is contiguous.) Use FRAME_PANED_* more often in the code to make things clearer. Update the diagram to show that the bottom gutter is inside the minibuffer (!) and that there are "junk boxes" when you have left and/or right gutters (dead boxes that are mistakenly left uncleared, unlike the corresponding scrollbar dead boxes). Update the text appropriately to cover the bottom gutter position, etc. Rewrite gutter-geometry code to use the FRAME_*_GUTTER_* in place of equivalent expressions referencing other frame elements, to make the code more portable in case we move around the gutter location. Cleanup FRAME_*_GUTTER_BOUNDS() in gutter.h. Add some #### GEOM! comments where I think code is incorrect -- typically, it wasn't fixed up properly when the gutter was added. Some cosmetic changes.
author Ben Wing <ben@xemacs.org>
date Wed, 03 Mar 2010 05:07:47 -0600
parents 5502045ec510
children 308d34e9f07d
comparison
equal deleted inserted replaced
5080:5502045ec510 5090:0ca81354c4c7
636 { 636 {
637 struct frame *f = XFRAME (w->frame); 637 struct frame *f = XFRAME (w->frame);
638 Lisp_Object window = wrap_window (w); 638 Lisp_Object window = wrap_window (w);
639 639
640 redisplay_clear_region (window, DEFAULT_INDEX, 640 redisplay_clear_region (window, DEFAULT_INDEX,
641 FRAME_LEFT_BORDER_START (f), y, 641 FRAME_LEFT_INTERNAL_BORDER_START (f), y,
642 FRAME_INTERNAL_BORDER_WIDTH (f), height); 642 FRAME_INTERNAL_BORDER_WIDTH (f), height);
643 } 643 }
644 644
645 /***************************************************************************** 645 /*****************************************************************************
646 clear_right_border 646 clear_right_border
647 647
652 { 652 {
653 struct frame *f = XFRAME (w->frame); 653 struct frame *f = XFRAME (w->frame);
654 Lisp_Object window = wrap_window (w); 654 Lisp_Object window = wrap_window (w);
655 655
656 redisplay_clear_region (window, DEFAULT_INDEX, 656 redisplay_clear_region (window, DEFAULT_INDEX,
657 FRAME_RIGHT_BORDER_START (f), 657 FRAME_RIGHT_INTERNAL_BORDER_START (f),
658 y, FRAME_INTERNAL_BORDER_WIDTH (f), height); 658 y, FRAME_INTERNAL_BORDER_WIDTH (f), height);
659 } 659 }
660 660
661 /***************************************************************************** 661 /*****************************************************************************
662 output_display_line 662 output_display_line
663 663
1661 1661
1662 dga->height = IMAGE_INSTANCE_PIXMAP_HEIGHT (p); 1662 dga->height = IMAGE_INSTANCE_PIXMAP_HEIGHT (p);
1663 dga->width = IMAGE_INSTANCE_PIXMAP_WIDTH (p); 1663 dga->width = IMAGE_INSTANCE_PIXMAP_WIDTH (p);
1664 1664
1665 #ifdef DEBUG_REDISPLAY 1665 #ifdef DEBUG_REDISPLAY
1666 printf ("redisplay_output_pixmap(request) \ 1666 printf ("redisplay_output_pixmap(request) [%dx%d@%d+%d] in [%dx%d@%d+%d]\n",
1667 [%dx%d@%d+%d] in [%dx%d@%d+%d]\n",
1668 db->width, db->height, db->xpos, db->ypos, 1667 db->width, db->height, db->xpos, db->ypos,
1669 dga->width, dga->height, dga->xoffset, dga->yoffset); 1668 dga->width, dga->height, dga->xoffset, dga->yoffset);
1670 #endif 1669 #endif
1671 1670
1672 /* This makes the glyph area fit into the display area. */ 1671 /* This makes the glyph area fit into the display area. */
1673 if (!redisplay_normalize_glyph_area (db, dga)) 1672 if (!redisplay_normalize_glyph_area (db, dga))
1674 return; 1673 return;
1675 1674
1676 #ifdef DEBUG_REDISPLAY 1675 #ifdef DEBUG_REDISPLAY
1677 printf ("redisplay_output_pixmap(normalized) \ 1676 printf ("redisplay_output_pixmap(normalized) [%dx%d@%d+%d] in [%dx%d@%d+%d]\n",
1678 [%dx%d@%d+%d] in [%dx%d@%d+%d]\n",
1679 db->width, db->height, db->xpos, db->ypos, 1677 db->width, db->height, db->xpos, db->ypos,
1680 dga->width, dga->height, dga->xoffset, dga->yoffset); 1678 dga->width, dga->height, dga->xoffset, dga->yoffset);
1681 #endif 1679 #endif
1682 1680
1683 /* Clear the area the pixmap is going into. The pixmap itself will 1681 /* Clear the area the pixmap is going into. The pixmap itself will
1747 redisplay_unmap_subwindows_maybe (f, x, y, width, height); 1745 redisplay_unmap_subwindows_maybe (f, x, y, width, height);
1748 1746
1749 /* #### This isn't quite right for when this function is called 1747 /* #### This isn't quite right for when this function is called
1750 from the toolbar code. */ 1748 from the toolbar code. */
1751 1749
1750 /* #### GEOM! This uses a backing pixmap in the gutter. Correct? */
1752 /* Don't use a backing pixmap in the border area */ 1751 /* Don't use a backing pixmap in the border area */
1753 if (x >= FRAME_LEFT_BORDER_END (f) 1752 if (x >= FRAME_LEFT_INTERNAL_BORDER_END (f)
1754 && x < FRAME_RIGHT_BORDER_START (f) 1753 && x < FRAME_RIGHT_INTERNAL_BORDER_START (f)
1755 && y >= FRAME_TOP_BORDER_END (f) 1754 && y >= FRAME_TOP_INTERNAL_BORDER_END (f)
1756 && y < FRAME_BOTTOM_BORDER_START (f)) 1755 && y < FRAME_BOTTOM_INTERNAL_BORDER_START (f))
1757 { 1756 {
1758 Lisp_Object temp; 1757 Lisp_Object temp;
1759 1758
1760 if (w) 1759 if (w)
1761 { 1760 {
2096 void 2095 void
2097 redisplay_clear_top_of_window (struct window *w) 2096 redisplay_clear_top_of_window (struct window *w)
2098 { 2097 {
2099 Lisp_Object window = wrap_window (w); 2098 Lisp_Object window = wrap_window (w);
2100 2099
2101 2100 /* #### GEOM! FIXME #### This is definitely wrong. It was clearly not
2101 fixed up to accommodate the gutter. The internal border width is now
2102 no longer adjacent to the leftmost window, since the gutter
2103 intervenes. */
2102 if (!NILP (Fwindow_highest_p (window))) 2104 if (!NILP (Fwindow_highest_p (window)))
2103 { 2105 {
2104 struct frame *f = XFRAME (w->frame); 2106 struct frame *f = XFRAME (w->frame);
2105 int x, y, width, height; 2107 int x, y, width, height;
2106 2108
2113 width += FRAME_INTERNAL_BORDER_WIDTH (f); 2115 width += FRAME_INTERNAL_BORDER_WIDTH (f);
2114 } 2116 }
2115 if (window_is_rightmost (w)) 2117 if (window_is_rightmost (w))
2116 width += FRAME_INTERNAL_BORDER_WIDTH (f); 2118 width += FRAME_INTERNAL_BORDER_WIDTH (f);
2117 2119
2118 y = FRAME_TOP_BORDER_START (f) - 1; 2120 /* #### This off-by-one stuff also occurs in XLIKE_clear_frame(). */
2121 y = FRAME_TOP_INTERNAL_BORDER_START (f) - 1;
2119 height = FRAME_INTERNAL_BORDER_HEIGHT (f) + 1; 2122 height = FRAME_INTERNAL_BORDER_HEIGHT (f) + 1;
2120 2123
2121 redisplay_clear_region (window, DEFAULT_INDEX, x, y, width, height); 2124 redisplay_clear_region (window, DEFAULT_INDEX, x, y, width, height);
2122 } 2125 }
2123 } 2126 }
2149 2152
2150 bounds = calculate_display_line_boundaries (w, bflag); 2153 bounds = calculate_display_line_boundaries (w, bflag);
2151 window = wrap_window (w); 2154 window = wrap_window (w);
2152 2155
2153 if (window_is_leftmost (w)) 2156 if (window_is_leftmost (w))
2154 redisplay_clear_region (window, DEFAULT_INDEX, FRAME_LEFT_BORDER_START (f), 2157 redisplay_clear_region (window, DEFAULT_INDEX,
2155 ypos1, FRAME_INTERNAL_BORDER_WIDTH (f), height); 2158 FRAME_LEFT_INTERNAL_BORDER_START (f),
2159 ypos1, FRAME_INTERNAL_BORDER_WIDTH (f),
2160 height);
2156 2161
2157 if (bounds.left_in - bounds.left_out > 0) 2162 if (bounds.left_in - bounds.left_out > 0)
2158 redisplay_clear_region (window, 2163 redisplay_clear_region (window,
2159 get_builtin_face_cache_index (w, Vleft_margin_face), 2164 get_builtin_face_cache_index
2165 (w, Vleft_margin_face),
2160 bounds.left_out, ypos1, 2166 bounds.left_out, ypos1,
2161 bounds.left_in - bounds.left_out, height); 2167 bounds.left_in - bounds.left_out, height);
2162 2168
2163 if (bounds.right_in - bounds.left_in > 0) 2169 if (bounds.right_in - bounds.left_in > 0)
2164 redisplay_clear_region (window, 2170 redisplay_clear_region (window,
2166 bounds.left_in, ypos1, 2172 bounds.left_in, ypos1,
2167 bounds.right_in - bounds.left_in, height); 2173 bounds.right_in - bounds.left_in, height);
2168 2174
2169 if (bounds.right_out - bounds.right_in > 0) 2175 if (bounds.right_out - bounds.right_in > 0)
2170 redisplay_clear_region (window, 2176 redisplay_clear_region (window,
2171 get_builtin_face_cache_index (w, Vright_margin_face), 2177 get_builtin_face_cache_index
2178 (w, Vright_margin_face),
2172 bounds.right_in, ypos1, 2179 bounds.right_in, ypos1,
2173 bounds.right_out - bounds.right_in, height); 2180 bounds.right_out - bounds.right_in,
2181 height);
2174 2182
2175 if (window_is_rightmost (w)) 2183 if (window_is_rightmost (w))
2176 redisplay_clear_region (window, DEFAULT_INDEX, FRAME_RIGHT_BORDER_START (f), 2184 redisplay_clear_region (window, DEFAULT_INDEX,
2177 ypos1, FRAME_INTERNAL_BORDER_WIDTH (f), height); 2185 FRAME_RIGHT_INTERNAL_BORDER_START (f),
2186 ypos1, FRAME_INTERNAL_BORDER_WIDTH (f),
2187 height);
2178 } 2188 }
2179 } 2189 }
2180 } 2190 }
2181 2191
2182 /***************************************************************************** 2192 /*****************************************************************************