Mercurial > hg > xemacs-beta
comparison src/frame.c @ 5128:7be849cb8828 ben-lisp-object
merge
author | Ben Wing <ben@xemacs.org> |
---|---|
date | Sun, 07 Mar 2010 02:09:59 -0600 |
parents | a9c41067dd88 0ca81354c4c7 |
children | 4f4672e2aa34 |
comparison
equal
deleted
inserted
replaced
5127:a9c41067dd88 | 5128:7be849cb8828 |
---|---|
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 |
3588 FRAME_NEW_HEIGHT (f) = 0; | 3601 FRAME_NEW_HEIGHT (f) = 0; |
3589 FRAME_NEW_WIDTH (f) = 0; | 3602 FRAME_NEW_WIDTH (f) = 0; |
3590 | 3603 |
3591 /* We need to remove the boundaries of the paned area (see top of file) | 3604 /* We need to remove the boundaries of the paned area (see top of file) |
3592 from the total-area pixel size, which is what we have now. | 3605 from the total-area pixel size, which is what we have now. |
3593 | 3606 */ |
3594 #### We should also be subtracting the internal borders. */ | |
3595 new_pixheight -= | 3607 new_pixheight -= |
3596 (FRAME_REAL_TOP_TOOLBAR_BOUNDS (f) | 3608 (FRAME_NONPANED_SIZE (f, TOP_EDGE) + FRAME_NONPANED_SIZE (f, BOTTOM_EDGE)); |
3597 + FRAME_REAL_BOTTOM_TOOLBAR_BOUNDS (f) | |
3598 + FRAME_TOP_GUTTER_BOUNDS (f) | |
3599 + FRAME_BOTTOM_GUTTER_BOUNDS (f)); | |
3600 | |
3601 new_pixwidth -= | 3609 new_pixwidth -= |
3602 (FRAME_REAL_LEFT_TOOLBAR_BOUNDS (f) | 3610 (FRAME_NONPANED_SIZE (f, LEFT_EDGE) + FRAME_NONPANED_SIZE (f, RIGHT_EDGE)); |
3603 + FRAME_REAL_RIGHT_TOOLBAR_BOUNDS (f) | 3611 |
3604 + FRAME_LEFT_GUTTER_BOUNDS (f) | 3612 XWINDOW (FRAME_ROOT_WINDOW (f))->pixel_top = FRAME_PANED_TOP_EDGE (f); |
3605 + FRAME_RIGHT_GUTTER_BOUNDS (f)); | |
3606 | |
3607 XWINDOW (FRAME_ROOT_WINDOW (f))->pixel_top | |
3608 = FRAME_TOP_BORDER_END (f) + FRAME_TOP_GUTTER_BOUNDS (f); | |
3609 | 3613 |
3610 if (FRAME_HAS_MINIBUF_P (f) | 3614 if (FRAME_HAS_MINIBUF_P (f) |
3611 && ! FRAME_MINIBUF_ONLY_P (f)) | 3615 && ! FRAME_MINIBUF_ONLY_P (f)) |
3612 /* Frame has both root and minibuffer. */ | 3616 /* Frame has both root and minibuffer. */ |
3613 { | 3617 { |
3629 set_window_pixheight (FRAME_ROOT_WINDOW (f), | 3633 set_window_pixheight (FRAME_ROOT_WINDOW (f), |
3630 /* - font_height for minibuffer */ | 3634 /* - font_height for minibuffer */ |
3631 new_pixheight - minibuf_height, 0); | 3635 new_pixheight - minibuf_height, 0); |
3632 | 3636 |
3633 XWINDOW (FRAME_MINIBUF_WINDOW (f))->pixel_top = | 3637 XWINDOW (FRAME_MINIBUF_WINDOW (f))->pixel_top = |
3634 FRAME_TOP_BORDER_END (f) + | 3638 FRAME_PANED_TOP_EDGE (f) + |
3635 FRAME_TOP_GUTTER_BOUNDS (f) + | |
3636 FRAME_BOTTOM_GUTTER_BOUNDS (f) + | 3639 FRAME_BOTTOM_GUTTER_BOUNDS (f) + |
3637 new_pixheight - minibuf_height; | 3640 new_pixheight - minibuf_height; |
3638 | 3641 |
3639 set_window_pixheight (FRAME_MINIBUF_WINDOW (f), minibuf_height, 0); | 3642 set_window_pixheight (FRAME_MINIBUF_WINDOW (f), minibuf_height, 0); |
3640 } | 3643 } |
3644 | 3647 |
3645 FRAME_HEIGHT (f) = newheight; | 3648 FRAME_HEIGHT (f) = newheight; |
3646 if (FRAME_TTY_P (f)) | 3649 if (FRAME_TTY_P (f)) |
3647 f->pixheight = newheight; | 3650 f->pixheight = newheight; |
3648 | 3651 |
3649 XWINDOW (FRAME_ROOT_WINDOW (f))->pixel_left = | 3652 XWINDOW (FRAME_ROOT_WINDOW (f))->pixel_left = FRAME_PANED_LEFT_EDGE (f); |
3650 FRAME_LEFT_BORDER_END (f) + FRAME_LEFT_GUTTER_BOUNDS (f); | |
3651 set_window_pixwidth (FRAME_ROOT_WINDOW (f), new_pixwidth, 0); | 3653 set_window_pixwidth (FRAME_ROOT_WINDOW (f), new_pixwidth, 0); |
3652 | 3654 |
3653 if (FRAME_HAS_MINIBUF_P (f)) | 3655 if (FRAME_HAS_MINIBUF_P (f)) |
3654 { | 3656 { |
3655 XWINDOW (FRAME_MINIBUF_WINDOW (f))->pixel_left = | 3657 XWINDOW (FRAME_MINIBUF_WINDOW (f))->pixel_left = |
3656 FRAME_LEFT_BORDER_END (f) + FRAME_LEFT_GUTTER_BOUNDS (f); | 3658 FRAME_PANED_LEFT_EDGE (f); |
3657 set_window_pixwidth (FRAME_MINIBUF_WINDOW (f), new_pixwidth, 0); | 3659 set_window_pixwidth (FRAME_MINIBUF_WINDOW (f), new_pixwidth, 0); |
3658 } | 3660 } |
3659 | 3661 |
3660 FRAME_WIDTH (f) = newwidth; | 3662 FRAME_WIDTH (f) = newwidth; |
3661 if (FRAME_TTY_P (f)) | 3663 if (FRAME_TTY_P (f)) |
3662 f->pixwidth = newwidth; | 3664 f->pixwidth = newwidth; |
3663 | 3665 |
3664 /* #### On MS Windows, this references FRAME_PIXWIDTH() and FRAME_PIXHEIGHT(). | 3666 /* #### On MS Windows, this references FRAME_PIXWIDTH() and |
3665 I'm not sure we can count on those values being set. Instead we should | 3667 FRAME_PIXHEIGHT(). I'm not sure we can count on those values being |
3666 use the total pixel size we got near the top by calling | 3668 set. Instead we should use the total pixel size we got near the top |
3667 frame_conversion_internal(). We should inline the logic in | 3669 by calling frame_conversion_internal(). We should inline the logic in |
3668 get_frame_char_size() here and change that function so it just looks | 3670 get_frame_char_size() here and change that function so it just looks |
3669 at FRAME_CHARWIDTH() and FRAME_CHARHEIGHT(). */ | 3671 at FRAME_CHARWIDTH() and FRAME_CHARHEIGHT(). */ |
3670 get_frame_char_size (f, &FRAME_CHARWIDTH (f), &FRAME_CHARHEIGHT (f)); | 3672 get_frame_char_size (f, &FRAME_CHARWIDTH (f), &FRAME_CHARHEIGHT (f)); |
3671 | 3673 |
3672 MARK_FRAME_TOOLBARS_CHANGED (f); | 3674 MARK_FRAME_TOOLBARS_CHANGED (f); |