diff src/frame.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 a04cf0fea770
children 868a5349acee 7be849cb8828
line wrap: on
line diff
--- a/src/frame.c	Thu Feb 25 16:19:01 2010 +0100
+++ b/src/frame.c	Wed Mar 03 05:07:47 2010 -0600
@@ -35,43 +35,43 @@
 | ###################################################################### |
 | #                               toolbar                              # |
 | #--------------------------------------------------------------------# |
-| #  |                            gutter                            |  # |
-| #  |--------------------------------------------------------------|  # |
-| #  | |                  internal border width                   | |  # |
-| #  | | ******************************************************** | |  # |
-|w#  | | *                         |s|v*                      |s* | |  #w|
-|i#  | | *                         |c|e*                      |c* | |  #i|
-|n#  | | *                         |r|r*                      |r* | |  #n|
-|d#  | | *                         |o|t*                      |o* | |  #d|
-|o#  | | *        text area        |l|.*      text area       |l* | |  #o|
-|w#  | |i*                         |l| *                      |l*i| |  #w|
-|-#  | |n*                         |b|d*                      |b*n| |  #-|
-|m#  | |t*                         |a|i*                      |a*t| |  #m|
-|a#  | |.*                         |r|v*                      |r*.| |  #a|
-|n# t| | *-------------------------+-|i*----------------------+-* | |t #n|
-|a# o|g|b*        scrollbar        | |d*      scrollbar       | *b|g|o #a|
-|g# o|u|o*-------------------------+-|e*----------------------+-*o|u|o #g|
-|e# l|t|r*        modeline           |r*      modeline          *r|t|l #e|
-|r# b|t|d********************************************************d|t|b #r|
-| # a|e|e*   =..texttexttex....=   |s|v*                      |s*e|e|a # |
-|d# r|r|r*o m=..texttexttextt..=o m|c|e*                      |c*r|r|r #d|
-|e#  | | *u a=.exttexttextte...=u a|r|r*                      |r* | |  #e|
-|c#  | |w*t r=....texttexttex..=t r|o|t*                      |o*w| |  #c|
-|o#  | |i*s g=        etc.     =s g|l|.*      text area       |l*i| |  #o|
-|r#  | |d*i i=                 =i i|l| *                      |l*d| |  #r|
-|a#  | |t*d n=                 =d n|b|d*                      |b*t| |  #a|
-|t#  | |h*e  = inner text area =e  |a|i*                      |a*h| |  #t|
+| #  |                        internal border                       |  # |
+| #  | +----------------------------------------------------------+ |  # |
+| #  | |                          gutter                          | |  # |
+| #  | |-********************************************************-| |  # |
+|w#  | | *@|        scrollbar        |v*                      |s* | |  #w|
+|i#  | | *-+-------------------------|e*                      |c* | |  #i|
+|n#  | | *s|                         |r*                      |r* | |  #n|
+|d#  | | *c|                         |t*                      |o* | |  #d|
+|o#  | | *r|                         |.*      text area       |l* | |  #o|
+|w#  |i| *o|                         | *                      |l* |i|  #w|
+|-#  |n| *l|        text area        |d*                      |b* |n|  #-|
+|m#  |t| *l|                         |i*                      |a* |t|  #m|
+|a#  |e| *b|                         |v*                      |r* |e|  #a|
+|n# t|r| *a|                         |i*----------------------+-* |r|t #n|
+|a# o|n|g*r|                         |d*      scrollbar       |@*g|n|o #a|
+|g# o|a|u*-+-------------------------|e*----------------------+-*u|a|o #g|
+|e# l|l|t*        modeline           |r*      modeline          *t|l|l #e|
+|r# b| |t********************************************************t| |b #r|
+| # a|b|e*   =..texttexttex....=   |s|v*                      |s*e|b|a # |
+|d# r|o|r*o m=..texttexttextt..=o m|c|e*                      |c*r|o|r #d|
+|e#  |r| *u a=.exttexttextte...=u a|r|r*                      |r* |r|  #e|
+|c#  |d| *t r=....texttexttex..=t r|o|t*                      |o* |d|  #c|
+|o#  |e| *s g=        etc.     =s g|l|.*      text area       |l* |e|  #o|
+|r#  |r| *i i=                 =i i|l| *                      |l* |r|  #r|
+|a#  | | *d n=                 =d n|b|d*                      |b* | |  #a|
+|t#  | | *e  = inner text area =e  |a|i*                      |a* | |  #t|
 |i#  | | *   =                 =   |r|v*                      |r* | |  #i|
 |o#  | | *---===================---+-|i*----------------------+-* | |  #o|
-|n#  | | *        scrollbar        | |d*      scrollbar       | * | |  #n|
+|n#  | | *        scrollbar        |@|d*      scrollbar       |@* | |  #n|
 | #  | | *-------------------------+-|e*----------------------+-* | |  # |
 | #  | | *        modeline           |r*      modeline          * | |  # |
-| #  | | ******************************************************** | |  # |
-| #  | | *                        minibuffer                    * | |  # |
-| #  | | ******************************************************** | |  # |
-| #  | |                   internal border width                  | |  # |
-| #  |--------------------------------------------------------------|  # |
-| #  |                             gutter                           |  # |
+| #  | |-********************************************************-| |  # |
+| #  | |                           gutter                         | |  # |
+| #  | |-********************************************************-| |  # |
+| #  | |@*                       minibuffer                     *@| |  # |
+| #  | +-********************************************************-+ |  # |
+| #  |                         internal border                      |  # |
 | #--------------------------------------------------------------------# |
 | #                                toolbar                             # |
 | ###################################################################### |
@@ -79,14 +79,17 @@
 +------------------------------------------------------------------------+
 
    # = boundary of client area; * = window boundaries, boundary of paned area
-   = = boundary of inner text area; . = inside margin area
+   = = boundary of inner text area; . = inside margin area; @ = dead boxes
 
    Note in particular what happens at the corners, where a "corner box"
    occurs.  Top and bottom toolbars take precedence over left and right
    toolbars, extending out horizontally into the corner boxes.  Gutters
    work the same way.  The corner box where the scrollbars meet, however,
    is assigned to neither scrollbar, and is known as the "dead box"; it is
-   an area that must be cleared specially.
+   an area that must be cleared specially.  There are similar dead boxes at
+   the bottom-right and bottom-left corners where the minibuffer and
+   left/right gutters meet, but there is currently a bug in that these dead
+   boxes are not explicitly cleared and may contain junk.
 
    THE FRAME
    ---------
@@ -184,13 +187,18 @@
    THE PANED AREA
    --------------
 
-   The area occupied by the "windows" is called the paned area.  Note that
-   this includes the minibuffer, which is just another window but is
-   special-cased in XEmacs.  Each window can include a horizontal and/or
-   vertical scrollbar, a modeline and a vertical divider to its right, as
-   well as the text area.  Only non-rightmost windows can include a
-   vertical divider. (The minibuffer normally does not include either
-   modeline or scrollbars.)
+   The area occupied by the "windows" is called the paned area.  Unfortunately,
+   because of the presence of the gutter *between* the minibuffer and other
+   windows, the bottom of the paned area is not well-defined -- does it
+   include the minibuffer (in which case it also includes the bottom gutter,
+   but none others) or does it not include the minibuffer? (In which case
+   not all windows are included.) #### GEOM! It would be cleaner to put the
+   bottom gutter *below* the minibuffer instead of above it.
+
+   Each window can include a horizontal and/or vertical scrollbar, a
+   modeline and a vertical divider to its right, as well as the text area.
+   Only non-rightmost windows can include a vertical divider. (The
+   minibuffer normally does not include either modeline or scrollbars.)
 
    Note that, because the toolbars and gutters are controlled by
    specifiers, and specifiers can have window-specific and buffer-specific
@@ -252,18 +260,23 @@
    specified default character because many X fonts have a default
    character with a zero or otherwise non-representative width.])
 
-   The displayable area is essentially the "theoretical" paned area of the
-   frame excluding the rightmost and bottom-most scrollbars.  In this
-   context, "theoretical" means that all calculations on based on
-   frame-level values for toolbar, gutter and scrollbar thicknesses.
-   Because these thicknesses are controlled by specifiers, and specifiers
-   can have window-specific and buffer-specific values, these calculations
-   may or may not reflect the actual size of the paned area or of the
-   scrollbars when any particular window is selected.  Note also that the
-   "displayable area" may not even be contiguous!  In particular, if the
-   frame-level value of the horizontal scrollbar height is non-zero, then
-   the displayable area includes the paned area above and below the bottom
-   horizontal scrollbar but not the scrollbar itself.
+   The displayable area is essentially the "theoretical" gutter area of the
+   frame, excluding the rightmost and bottom-most scrollbars.  That is, it
+   starts from the client (or "total") area and then excludes the
+   "theoretical" toolbars and bottom-most/rightmost scrollbars, and the
+   internal border width.  In this context, "theoretical" means that all
+   calculations on based on frame-level values for toolbar and scrollbar
+   thicknesses.  Because these thicknesses are controlled by specifiers,
+   and specifiers can have window-specific and buffer-specific values,
+   these calculations may or may not reflect the actual size of the paned
+   area or of the scrollbars when any particular window is selected.  Note
+   also that the "displayable area" may not even be contiguous!  In
+   particular, the gutters are included, but the bottom-most and rightmost
+   scrollbars are excluded even though they are inside of the gutters.
+   Furthermore, if the frame-level value of the horizontal scrollbar height
+   is non-zero, then the displayable area includes the paned area above and
+   below the bottom horizontal scrollbar (i.e. the modeline and minibuffer)
+   but not the scrollbar itself.
 
    As a further twist, the character-dimension calculations are adjusted so
    that the truncation and continuation glyphs (see `truncation-glyph' and