Mercurial > hg > xemacs-beta
comparison src/frame-impl.h @ 5045:c3cc3fa503a2
more frame-sizing cleanups
-------------------- ChangeLog entries follow: --------------------
man/ChangeLog addition:
2010-02-16 Ben Wing <ben@xemacs.org>
* internals/internals.texi (Top):
* internals/internals.texi (Modules for the Basic Displayable Lisp Objects):
* internals/internals.texi (Creating a Window-System Type):
* internals/internals.texi (Window and Frame Geometry):
* internals/internals.texi (Intro to Window and Frame Geometry):
* internals/internals.texi (The Frame):
* internals/internals.texi (The Non-Client Area):
* internals/internals.texi (The Client Area):
* internals/internals.texi (The Paned Area):
* internals/internals.texi (Text Areas):
* internals/internals.texi (The Displayable Area):
* internals/internals.texi (Which Functions Use Which?):
* internals/internals.texi (The Redisplay Mechanism):
Integrate the long comment in frame.c into the internals manual.
src/ChangeLog addition:
2010-02-16 Ben Wing <ben@xemacs.org>
* frame-impl.h:
* frame-impl.h (FRAME_INTERNAL_BORDER_WIDTH):
* frame-impl.h (FRAME_REAL_TOOLBAR_BOUNDS):
* frame-impl.h (FRAME_REAL_TOP_TOOLBAR_BOUNDS):
* frame-impl.h (FRAME_BOTTOM_BORDER_START):
* frame-impl.h (FRAME_LEFT_BORDER_START):
* frame-impl.h (FRAME_RIGHT_BORDER_START):
* frame.c (frame_conversion_internal_1):
* frame.c (change_frame_size_1):
* redisplay-output.c (clear_left_border):
* redisplay-output.c (clear_right_border):
* redisplay-output.c (redisplay_clear_top_of_window):
* redisplay-output.c (redisplay_clear_to_window_end):
* redisplay-output.c (redisplay_clear_bottom_of_window):
Rename FRAME_BORDER_* to FRAME_INTERNAL_BORDER_*. Add
general FRAME_INTERNAL_BORDER_SIZE(). Add FRAME_REAL_TOOLBAR_BOUNDS()
to encompass the entire size of the toolbar including its border.
Add specific top/left/bottom/right versions of this macro.
Rewrite FRAME_*_BORDER_START and FRAME_*_BORDER_END to take into use
FRAME_REAL_*_TOOLBAR_BOUNDS(). Add some comments about existing
problems in frame sizing and how they might be fixed. Simplify
change_frame_size_1() using the macros just created.
author | Ben Wing <ben@xemacs.org> |
---|---|
date | Tue, 16 Feb 2010 01:21:32 -0600 |
parents | 1e7cc382eb16 |
children | d372b17f63ce 2a462149bd6a |
comparison
equal
deleted
inserted
replaced
5044:e84a30b0e4a2 | 5045:c3cc3fa503a2 |
---|---|
1 /* Define frame-object for XEmacs. | 1 /* Define frame-object for XEmacs. |
2 Copyright (C) 1988, 1992, 1993, 1994 Free Software Foundation, Inc. | 2 Copyright (C) 1988, 1992, 1993, 1994 Free Software Foundation, Inc. |
3 Copyright (C) 1995 Ben Wing. | 3 Copyright (C) 1995, 2010 Ben Wing. |
4 | 4 |
5 This file is part of XEmacs. | 5 This file is part of XEmacs. |
6 | 6 |
7 XEmacs is free software; you can redistribute it and/or modify it | 7 XEmacs is free software; you can redistribute it and/or modify it |
8 under the terms of the GNU General Public License as published by the | 8 under the terms of the GNU General Public License as published by the |
541 (f)->visible = (f)->async_visible, \ | 541 (f)->visible = (f)->async_visible, \ |
542 (f)->iconified = (f)->async_iconified) | 542 (f)->iconified = (f)->async_iconified) |
543 | 543 |
544 #endif /* FSFmacs */ | 544 #endif /* FSFmacs */ |
545 | 545 |
546 #define FRAME_BORDER_WIDTH(f) ((f)->internal_border_width) | 546 #define FRAME_INTERNAL_BORDER_WIDTH(f) ((f)->internal_border_width) |
547 #define FRAME_BORDER_HEIGHT(f) ((f)->internal_border_width) | 547 #define FRAME_INTERNAL_BORDER_HEIGHT(f) ((f)->internal_border_width) |
548 #define FRAME_INTERNAL_BORDER_SIZE(f, pos) ((f)->internal_border_width) | |
549 | |
550 /************************************************************************/ | |
551 /* toolbars */ | |
552 /************************************************************************/ | |
553 | |
554 /*---------------- Theoretical and real toolbar values ----------------*/ | |
555 | |
548 | 556 |
549 /* This returns the frame-local value; that tells you what you should | 557 /* This returns the frame-local value; that tells you what you should |
550 use when computing the frame size. It is *not* the actual toolbar | 558 use when computing the frame size. It is *not* the actual toolbar |
551 size because that depends on the selected window. Use the macros | 559 size because that depends on the selected window. Use the macros |
552 below for that. | 560 below for that. |
655 ((!NILP (FRAME_REAL_TOOLBAR (f, pos)) \ | 663 ((!NILP (FRAME_REAL_TOOLBAR (f, pos)) \ |
656 && FRAME_RAW_REAL_TOOLBAR_VISIBLE (f, pos)) \ | 664 && FRAME_RAW_REAL_TOOLBAR_VISIBLE (f, pos)) \ |
657 ? FRAME_RAW_REAL_TOOLBAR_BORDER_WIDTH (f, pos) \ | 665 ? FRAME_RAW_REAL_TOOLBAR_BORDER_WIDTH (f, pos) \ |
658 : 0) | 666 : 0) |
659 | 667 |
668 #define FRAME_REAL_TOOLBAR_BOUNDS(f, pos) \ | |
669 (FRAME_REAL_TOOLBAR_SIZE (f, pos) + \ | |
670 2 * FRAME_REAL_TOOLBAR_BORDER_WIDTH (f, pos)) | |
671 | |
660 #define FRAME_REAL_TOP_TOOLBAR_HEIGHT(f) \ | 672 #define FRAME_REAL_TOP_TOOLBAR_HEIGHT(f) \ |
661 FRAME_REAL_TOOLBAR_SIZE (f, TOP_TOOLBAR) | 673 FRAME_REAL_TOOLBAR_SIZE (f, TOP_TOOLBAR) |
662 #define FRAME_REAL_BOTTOM_TOOLBAR_HEIGHT(f) \ | 674 #define FRAME_REAL_BOTTOM_TOOLBAR_HEIGHT(f) \ |
663 FRAME_REAL_TOOLBAR_SIZE (f, BOTTOM_TOOLBAR) | 675 FRAME_REAL_TOOLBAR_SIZE (f, BOTTOM_TOOLBAR) |
664 #define FRAME_REAL_LEFT_TOOLBAR_WIDTH(f) \ | 676 #define FRAME_REAL_LEFT_TOOLBAR_WIDTH(f) \ |
682 #define FRAME_REAL_LEFT_TOOLBAR_VISIBLE(f) \ | 694 #define FRAME_REAL_LEFT_TOOLBAR_VISIBLE(f) \ |
683 FRAME_REAL_TOOLBAR_VISIBLE (f, LEFT_TOOLBAR) | 695 FRAME_REAL_TOOLBAR_VISIBLE (f, LEFT_TOOLBAR) |
684 #define FRAME_REAL_RIGHT_TOOLBAR_VISIBLE(f) \ | 696 #define FRAME_REAL_RIGHT_TOOLBAR_VISIBLE(f) \ |
685 FRAME_REAL_TOOLBAR_VISIBLE (f, RIGHT_TOOLBAR) | 697 FRAME_REAL_TOOLBAR_VISIBLE (f, RIGHT_TOOLBAR) |
686 | 698 |
699 #define FRAME_REAL_TOP_TOOLBAR_BOUNDS(f) \ | |
700 FRAME_REAL_TOOLBAR_BOUNDS (f, TOP_TOOLBAR) | |
701 #define FRAME_REAL_BOTTOM_TOOLBAR_BOUNDS(f) \ | |
702 FRAME_REAL_TOOLBAR_BOUNDS (f, BOTTOM_TOOLBAR) | |
703 #define FRAME_REAL_LEFT_TOOLBAR_BOUNDS(f) \ | |
704 FRAME_REAL_TOOLBAR_BOUNDS (f, LEFT_TOOLBAR) | |
705 #define FRAME_REAL_RIGHT_TOOLBAR_BOUNDS(f) \ | |
706 FRAME_REAL_TOOLBAR_BOUNDS (f, RIGHT_TOOLBAR) | |
707 | |
708 /************************************************************************/ | |
709 /* frame dimensions defined using toolbars and gutters */ | |
710 /************************************************************************/ | |
711 | |
712 /* #### These should be using the gutter sizes, but aren't yet */ | |
713 | |
687 #define FRAME_TOP_BORDER_START(f) \ | 714 #define FRAME_TOP_BORDER_START(f) \ |
688 (FRAME_REAL_TOP_TOOLBAR_HEIGHT (f) + \ | 715 FRAME_REAL_TOP_TOOLBAR_BOUNDS (f) |
689 2 * FRAME_REAL_TOP_TOOLBAR_BORDER_WIDTH (f)) | |
690 #define FRAME_TOP_BORDER_END(f) \ | 716 #define FRAME_TOP_BORDER_END(f) \ |
691 (FRAME_TOP_BORDER_START (f) + FRAME_BORDER_HEIGHT (f)) | 717 (FRAME_TOP_BORDER_START (f) + FRAME_INTERNAL_BORDER_HEIGHT (f)) |
692 | 718 |
693 #define FRAME_BOTTOM_BORDER_START(f) \ | 719 #define FRAME_BOTTOM_BORDER_START(f) \ |
694 (FRAME_PIXHEIGHT (f) - FRAME_BORDER_HEIGHT (f) - \ | 720 (FRAME_BOTTOM_BORDER_END (f) - FRAME_INTERNAL_BORDER_HEIGHT (f)) |
695 FRAME_REAL_BOTTOM_TOOLBAR_HEIGHT (f) - \ | |
696 2 * FRAME_REAL_BOTTOM_TOOLBAR_BORDER_WIDTH (f)) | |
697 #define FRAME_BOTTOM_BORDER_END(f) \ | 721 #define FRAME_BOTTOM_BORDER_END(f) \ |
698 (FRAME_PIXHEIGHT (f) - FRAME_REAL_BOTTOM_TOOLBAR_HEIGHT (f) - \ | 722 (FRAME_PIXHEIGHT (f) - FRAME_REAL_BOTTOM_TOOLBAR_BOUNDS (f)) |
699 2 * FRAME_REAL_BOTTOM_TOOLBAR_BORDER_WIDTH (f)) | |
700 | 723 |
701 #define FRAME_LEFT_BORDER_START(f) \ | 724 #define FRAME_LEFT_BORDER_START(f) \ |
702 (FRAME_REAL_LEFT_TOOLBAR_WIDTH (f) + \ | 725 FRAME_REAL_LEFT_TOOLBAR_BOUNDS (f) |
703 2 * FRAME_REAL_LEFT_TOOLBAR_BORDER_WIDTH (f)) | |
704 #define FRAME_LEFT_BORDER_END(f) \ | 726 #define FRAME_LEFT_BORDER_END(f) \ |
705 (FRAME_LEFT_BORDER_START (f) + FRAME_BORDER_WIDTH (f)) | 727 (FRAME_LEFT_BORDER_START (f) + FRAME_INTERNAL_BORDER_WIDTH (f)) |
706 | 728 |
707 #define FRAME_RIGHT_BORDER_START(f) \ | 729 #define FRAME_RIGHT_BORDER_START(f) \ |
708 (FRAME_PIXWIDTH (f) - FRAME_BORDER_WIDTH (f) - \ | 730 (FRAME_RIGHT_BORDER_END (f) - FRAME_INTERNAL_BORDER_WIDTH (f)) |
709 FRAME_REAL_RIGHT_TOOLBAR_WIDTH(f) - \ | |
710 2 * FRAME_REAL_RIGHT_TOOLBAR_BORDER_WIDTH (f)) | |
711 #define FRAME_RIGHT_BORDER_END(f) \ | 731 #define FRAME_RIGHT_BORDER_END(f) \ |
712 (FRAME_PIXWIDTH (f) - FRAME_REAL_RIGHT_TOOLBAR_WIDTH (f) - \ | 732 (FRAME_PIXWIDTH (f) - FRAME_REAL_RIGHT_TOOLBAR_BOUNDS (f)) |
713 2 * FRAME_REAL_RIGHT_TOOLBAR_BORDER_WIDTH(f)) | |
714 | 733 |
715 #endif /* INCLUDED_frame_impl_h_ */ | 734 #endif /* INCLUDED_frame_impl_h_ */ |