comparison 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
comparison
equal deleted inserted replaced
5080:5502045ec510 5090:0ca81354c4c7
33 | +--------------------------------------------------------------------+ | 33 | +--------------------------------------------------------------------+ |
34 | | menubar | | 34 | | menubar | |
35 | ###################################################################### | 35 | ###################################################################### |
36 | # toolbar # | 36 | # toolbar # |
37 | #--------------------------------------------------------------------# | 37 | #--------------------------------------------------------------------# |
38 | # | gutter | # | 38 | # | internal border | # |
39 | # |--------------------------------------------------------------| # | 39 | # | +----------------------------------------------------------+ | # |
40 | # | | internal border width | | # | 40 | # | | gutter | | # |
41 | # | | ******************************************************** | | # | 41 | # | |-********************************************************-| | # |
42 |w# | | * |s|v* |s* | | #w| 42 |w# | | *@| scrollbar |v* |s* | | #w|
43 |i# | | * |c|e* |c* | | #i| 43 |i# | | *-+-------------------------|e* |c* | | #i|
44 |n# | | * |r|r* |r* | | #n| 44 |n# | | *s| |r* |r* | | #n|
45 |d# | | * |o|t* |o* | | #d| 45 |d# | | *c| |t* |o* | | #d|
46 |o# | | * text area |l|.* text area |l* | | #o| 46 |o# | | *r| |.* text area |l* | | #o|
47 |w# | |i* |l| * |l*i| | #w| 47 |w# |i| *o| | * |l* |i| #w|
48 |-# | |n* |b|d* |b*n| | #-| 48 |-# |n| *l| text area |d* |b* |n| #-|
49 |m# | |t* |a|i* |a*t| | #m| 49 |m# |t| *l| |i* |a* |t| #m|
50 |a# | |.* |r|v* |r*.| | #a| 50 |a# |e| *b| |v* |r* |e| #a|
51 |n# t| | *-------------------------+-|i*----------------------+-* | |t #n| 51 |n# t|r| *a| |i*----------------------+-* |r|t #n|
52 |a# o|g|b* scrollbar | |d* scrollbar | *b|g|o #a| 52 |a# o|n|g*r| |d* scrollbar |@*g|n|o #a|
53 |g# o|u|o*-------------------------+-|e*----------------------+-*o|u|o #g| 53 |g# o|a|u*-+-------------------------|e*----------------------+-*u|a|o #g|
54 |e# l|t|r* modeline |r* modeline *r|t|l #e| 54 |e# l|l|t* modeline |r* modeline *t|l|l #e|
55 |r# b|t|d********************************************************d|t|b #r| 55 |r# b| |t********************************************************t| |b #r|
56 | # a|e|e* =..texttexttex....= |s|v* |s*e|e|a # | 56 | # a|b|e* =..texttexttex....= |s|v* |s*e|b|a # |
57 |d# r|r|r*o m=..texttexttextt..=o m|c|e* |c*r|r|r #d| 57 |d# r|o|r*o m=..texttexttextt..=o m|c|e* |c*r|o|r #d|
58 |e# | | *u a=.exttexttextte...=u a|r|r* |r* | | #e| 58 |e# |r| *u a=.exttexttextte...=u a|r|r* |r* |r| #e|
59 |c# | |w*t r=....texttexttex..=t r|o|t* |o*w| | #c| 59 |c# |d| *t r=....texttexttex..=t r|o|t* |o* |d| #c|
60 |o# | |i*s g= etc. =s g|l|.* text area |l*i| | #o| 60 |o# |e| *s g= etc. =s g|l|.* text area |l* |e| #o|
61 |r# | |d*i i= =i i|l| * |l*d| | #r| 61 |r# |r| *i i= =i i|l| * |l* |r| #r|
62 |a# | |t*d n= =d n|b|d* |b*t| | #a| 62 |a# | | *d n= =d n|b|d* |b* | | #a|
63 |t# | |h*e = inner text area =e |a|i* |a*h| | #t| 63 |t# | | *e = inner text area =e |a|i* |a* | | #t|
64 |i# | | * = = |r|v* |r* | | #i| 64 |i# | | * = = |r|v* |r* | | #i|
65 |o# | | *---===================---+-|i*----------------------+-* | | #o| 65 |o# | | *---===================---+-|i*----------------------+-* | | #o|
66 |n# | | * scrollbar | |d* scrollbar | * | | #n| 66 |n# | | * scrollbar |@|d* scrollbar |@* | | #n|
67 | # | | *-------------------------+-|e*----------------------+-* | | # | 67 | # | | *-------------------------+-|e*----------------------+-* | | # |
68 | # | | * modeline |r* modeline * | | # | 68 | # | | * modeline |r* modeline * | | # |
69 | # | | ******************************************************** | | # | 69 | # | |-********************************************************-| | # |
70 | # | | * minibuffer * | | # | 70 | # | | gutter | | # |
71 | # | | ******************************************************** | | # | 71 | # | |-********************************************************-| | # |
72 | # | | internal border width | | # | 72 | # | |@* minibuffer *@| | # |
73 | # |--------------------------------------------------------------| # | 73 | # | +-********************************************************-+ | # |
74 | # | gutter | # | 74 | # | internal border | # |
75 | #--------------------------------------------------------------------# | 75 | #--------------------------------------------------------------------# |
76 | # toolbar # | 76 | # toolbar # |
77 | ###################################################################### | 77 | ###################################################################### |
78 | window manager decoration | 78 | window manager decoration |
79 +------------------------------------------------------------------------+ 79 +------------------------------------------------------------------------+
80 80
81 # = boundary of client area; * = window boundaries, boundary of paned area 81 # = boundary of client area; * = window boundaries, boundary of paned area
82 = = boundary of inner text area; . = inside margin area 82 = = boundary of inner text area; . = inside margin area; @ = dead boxes
83 83
84 Note in particular what happens at the corners, where a "corner box" 84 Note in particular what happens at the corners, where a "corner box"
85 occurs. Top and bottom toolbars take precedence over left and right 85 occurs. Top and bottom toolbars take precedence over left and right
86 toolbars, extending out horizontally into the corner boxes. Gutters 86 toolbars, extending out horizontally into the corner boxes. Gutters
87 work the same way. The corner box where the scrollbars meet, however, 87 work the same way. The corner box where the scrollbars meet, however,
88 is assigned to neither scrollbar, and is known as the "dead box"; it is 88 is assigned to neither scrollbar, and is known as the "dead box"; it is
89 an area that must be cleared specially. 89 an area that must be cleared specially. There are similar dead boxes at
90 the bottom-right and bottom-left corners where the minibuffer and
91 left/right gutters meet, but there is currently a bug in that these dead
92 boxes are not explicitly cleared and may contain junk.
90 93
91 THE FRAME 94 THE FRAME
92 --------- 95 ---------
93 96
94 The "top-level window area" is the entire area of a top-level window (or 97 The "top-level window area" is the entire area of a top-level window (or
182 185
183 186
184 THE PANED AREA 187 THE PANED AREA
185 -------------- 188 --------------
186 189
187 The area occupied by the "windows" is called the paned area. Note that 190 The area occupied by the "windows" is called the paned area. Unfortunately,
188 this includes the minibuffer, which is just another window but is 191 because of the presence of the gutter *between* the minibuffer and other
189 special-cased in XEmacs. Each window can include a horizontal and/or 192 windows, the bottom of the paned area is not well-defined -- does it
190 vertical scrollbar, a modeline and a vertical divider to its right, as 193 include the minibuffer (in which case it also includes the bottom gutter,
191 well as the text area. Only non-rightmost windows can include a 194 but none others) or does it not include the minibuffer? (In which case
192 vertical divider. (The minibuffer normally does not include either 195 not all windows are included.) #### GEOM! It would be cleaner to put the
193 modeline or scrollbars.) 196 bottom gutter *below* the minibuffer instead of above it.
197
198 Each window can include a horizontal and/or vertical scrollbar, a
199 modeline and a vertical divider to its right, as well as the text area.
200 Only non-rightmost windows can include a vertical divider. (The
201 minibuffer normally does not include either modeline or scrollbars.)
194 202
195 Note that, because the toolbars and gutters are controlled by 203 Note that, because the toolbars and gutters are controlled by
196 specifiers, and specifiers can have window-specific and buffer-specific 204 specifiers, and specifiers can have window-specific and buffer-specific
197 values, the size of the paned area can change depending on which window 205 values, the size of the paned area can change depending on which window
198 is selected: In other words, if the selected window or buffer changes, 206 is selected: In other words, if the selected window or buffer changes,
250 Under X, this is based on the width of the lowercase 'n', or if this is 258 Under X, this is based on the width of the lowercase 'n', or if this is
251 zero then the width of the default character. [We prefer 'n' to the 259 zero then the width of the default character. [We prefer 'n' to the
252 specified default character because many X fonts have a default 260 specified default character because many X fonts have a default
253 character with a zero or otherwise non-representative width.]) 261 character with a zero or otherwise non-representative width.])
254 262
255 The displayable area is essentially the "theoretical" paned area of the 263 The displayable area is essentially the "theoretical" gutter area of the
256 frame excluding the rightmost and bottom-most scrollbars. In this 264 frame, excluding the rightmost and bottom-most scrollbars. That is, it
257 context, "theoretical" means that all calculations on based on 265 starts from the client (or "total") area and then excludes the
258 frame-level values for toolbar, gutter and scrollbar thicknesses. 266 "theoretical" toolbars and bottom-most/rightmost scrollbars, and the
259 Because these thicknesses are controlled by specifiers, and specifiers 267 internal border width. In this context, "theoretical" means that all
260 can have window-specific and buffer-specific values, these calculations 268 calculations on based on frame-level values for toolbar and scrollbar
261 may or may not reflect the actual size of the paned area or of the 269 thicknesses. Because these thicknesses are controlled by specifiers,
262 scrollbars when any particular window is selected. Note also that the 270 and specifiers can have window-specific and buffer-specific values,
263 "displayable area" may not even be contiguous! In particular, if the 271 these calculations may or may not reflect the actual size of the paned
264 frame-level value of the horizontal scrollbar height is non-zero, then 272 area or of the scrollbars when any particular window is selected. Note
265 the displayable area includes the paned area above and below the bottom 273 also that the "displayable area" may not even be contiguous! In
266 horizontal scrollbar but not the scrollbar itself. 274 particular, the gutters are included, but the bottom-most and rightmost
275 scrollbars are excluded even though they are inside of the gutters.
276 Furthermore, if the frame-level value of the horizontal scrollbar height
277 is non-zero, then the displayable area includes the paned area above and
278 below the bottom horizontal scrollbar (i.e. the modeline and minibuffer)
279 but not the scrollbar itself.
267 280
268 As a further twist, the character-dimension calculations are adjusted so 281 As a further twist, the character-dimension calculations are adjusted so
269 that the truncation and continuation glyphs (see `truncation-glyph' and 282 that the truncation and continuation glyphs (see `truncation-glyph' and
270 `continuation-glyph') count as a single character even if they are wider 283 `continuation-glyph') count as a single character even if they are wider
271 than the default font width. (Technically, the character width is 284 than the default font width. (Technically, the character width is