comparison src/frame-impl.h @ 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 7be849cb8828
comparison
equal deleted inserted replaced
5080:5502045ec510 5090:0ca81354c4c7
703 703
704 /************************************************************************/ 704 /************************************************************************/
705 /* frame dimensions defined using toolbars and gutters */ 705 /* frame dimensions defined using toolbars and gutters */
706 /************************************************************************/ 706 /************************************************************************/
707 707
708 /* #### These should be using the gutter sizes, but aren't yet */
709
710 #define FRAME_TOP_BORDER_START(f) \
711 FRAME_REAL_TOP_TOOLBAR_BOUNDS (f)
712 #define FRAME_TOP_BORDER_END(f) \
713 (FRAME_TOP_BORDER_START (f) + FRAME_INTERNAL_BORDER_HEIGHT (f))
714
715 #define FRAME_BOTTOM_BORDER_START(f) \
716 (FRAME_BOTTOM_BORDER_END (f) - FRAME_INTERNAL_BORDER_HEIGHT (f))
717 #define FRAME_BOTTOM_BORDER_END(f) \
718 (FRAME_PIXHEIGHT (f) - FRAME_REAL_BOTTOM_TOOLBAR_BOUNDS (f))
719
720 #define FRAME_LEFT_BORDER_START(f) \
721 FRAME_REAL_LEFT_TOOLBAR_BOUNDS (f)
722 #define FRAME_LEFT_BORDER_END(f) \
723 (FRAME_LEFT_BORDER_START (f) + FRAME_INTERNAL_BORDER_WIDTH (f))
724
725 #define FRAME_RIGHT_BORDER_START(f) \
726 (FRAME_RIGHT_BORDER_END (f) - FRAME_INTERNAL_BORDER_WIDTH (f))
727 #define FRAME_RIGHT_BORDER_END(f) \
728 (FRAME_PIXWIDTH (f) - FRAME_REAL_RIGHT_TOOLBAR_BOUNDS (f))
729
730
731 /************************************************************************/
732 /* frame dimensions defined using toolbars and gutters */
733 /************************************************************************/
734
735 /* Bounds of the area framed by the toolbars is the client area -- 708 /* Bounds of the area framed by the toolbars is the client area --
736 (0, 0) - (FRAME_PIXWIDTH, FRAME_PIXHEIGHT). */ 709 (0, 0) - (FRAME_PIXWIDTH, FRAME_PIXHEIGHT). */
737 710
738 /* Bounds of the area framed by the gutters -- inside of the toolbars,
739 outside of everything else. */
740
741 #define FRAME_GUTTER_TOP_EDGE(f) \
742 FRAME_REAL_TOOLBAR_BOUNDS (f, TOP_EDGE)
743 #define FRAME_GUTTER_BOTTOM_EDGE(f) \
744 (FRAME_PIXHEIGHT (f) - FRAME_REAL_TOOLBAR_BOUNDS (f, BOTTOM_EDGE))
745 #define FRAME_GUTTER_LEFT_EDGE(f) \
746 FRAME_REAL_TOOLBAR_BOUNDS (f, LEFT_EDGE)
747 #define FRAME_GUTTER_RIGHT_EDGE(f) \
748 (FRAME_PIXWIDTH (f) - FRAME_REAL_TOOLBAR_BOUNDS (f, RIGHT_EDGE))
749
750 /* Bounds of the area framed by the internal border width -- inside of the 711 /* Bounds of the area framed by the internal border width -- inside of the
751 toolbars and gutters. */ 712 toolbars, outside of everything else. */
752 713
753 #define FRAME_INTERNAL_BORDER_TOP_EDGE(f) \ 714 #define FRAME_TOP_INTERNAL_BORDER_START(f) \
754 (FRAME_GUTTER_TOP_EDGE (f) + FRAME_GUTTER_BOUNDS (f, TOP_EDGE)) 715 FRAME_REAL_TOP_TOOLBAR_BOUNDS (f)
755 #define FRAME_INTERNAL_BORDER_BOTTOM_EDGE(f) \ 716 #define FRAME_TOP_INTERNAL_BORDER_END(f) \
756 (FRAME_GUTTER_BOTTOM_EDGE (f) - FRAME_GUTTER_BOUNDS (f, BOTTOM_EDGE)) 717 (FRAME_TOP_INTERNAL_BORDER_START (f) + FRAME_INTERNAL_BORDER_HEIGHT (f))
757 #define FRAME_INTERNAL_BORDER_LEFT_EDGE(f) \ 718
758 (FRAME_GUTTER_LEFT_EDGE (f) + FRAME_GUTTER_BOUNDS (f, LEFT_EDGE)) 719 #define FRAME_BOTTOM_INTERNAL_BORDER_START(f) \
759 #define FRAME_INTERNAL_BORDER_RIGHT_EDGE(f) \ 720 (FRAME_BOTTOM_INTERNAL_BORDER_END (f) - FRAME_INTERNAL_BORDER_HEIGHT (f))
760 (FRAME_GUTTER_RIGHT_EDGE (f) - FRAME_GUTTER_BOUNDS (f, RIGHT_EDGE)) 721 #define FRAME_BOTTOM_INTERNAL_BORDER_END(f) \
722 (FRAME_PIXHEIGHT (f) - FRAME_REAL_BOTTOM_TOOLBAR_BOUNDS (f))
723
724 #define FRAME_LEFT_INTERNAL_BORDER_START(f) \
725 FRAME_REAL_LEFT_TOOLBAR_BOUNDS (f)
726 #define FRAME_LEFT_INTERNAL_BORDER_END(f) \
727 (FRAME_LEFT_INTERNAL_BORDER_START (f) + FRAME_INTERNAL_BORDER_WIDTH (f))
728
729 #define FRAME_RIGHT_INTERNAL_BORDER_START(f) \
730 (FRAME_RIGHT_INTERNAL_BORDER_END (f) - FRAME_INTERNAL_BORDER_WIDTH (f))
731 #define FRAME_RIGHT_INTERNAL_BORDER_END(f) \
732 (FRAME_PIXWIDTH (f) - FRAME_REAL_RIGHT_TOOLBAR_BOUNDS (f))
733
734 /* Bounds of the area framed by the gutter -- inside of the
735 toolbars and internal border width. */
736
737 #define FRAME_TOP_GUTTER_START(f) \
738 FRAME_TOP_INTERNAL_BORDER_END (f)
739 #define FRAME_TOP_GUTTER_END(f) \
740 (FRAME_TOP_GUTTER_START (f) + FRAME_TOP_GUTTER_BOUNDS (f))
741
742 #ifdef BOTTOM_GUTTER_IS_OUTSIDE_MINIBUFFER
743 #define FRAME_BOTTOM_GUTTER_START(f) \
744 (FRAME_BOTTOM_GUTTER_END (f) - FRAME_BOTTOM_GUTTER_BOUNDS (f))
745 #define FRAME_BOTTOM_GUTTER_END(f) \
746 FRAME_BOTTOM_INTERNAL_BORDER_START (f)
747 #endif /* BOTTOM_GUTTER_IS_OUTSIDE_MINIBUFFER */
748
749 #define FRAME_LEFT_GUTTER_START(f) \
750 FRAME_LEFT_INTERNAL_BORDER_END (f)
751 #define FRAME_LEFT_GUTTER_END(f) \
752 (FRAME_LEFT_GUTTER_START (f) + FRAME_LEFT_GUTTER_BOUNDS (f))
753
754 #define FRAME_RIGHT_GUTTER_START(f) \
755 (FRAME_RIGHT_GUTTER_END (f) - FRAME_RIGHT_GUTTER_BOUNDS (f))
756 #define FRAME_RIGHT_GUTTER_END(f) \
757 FRAME_RIGHT_INTERNAL_BORDER_START (f)
761 758
762 /* These are the bounds of the paned area -- inside of the toolbars, 759 /* These are the bounds of the paned area -- inside of the toolbars,
763 gutters, and internal border width. The paned area is the same as the 760 gutters, and internal border width. The paned area is the same as the
764 area occupied by windows, including the minibuffer. See long comment in 761 area occupied by windows, including the minibuffer. See long comment in
765 frame.c. */ 762 frame.c. */
766 763
767 #define FRAME_PANED_TOP_EDGE(f) \ 764 #define FRAME_PANED_TOP_EDGE(f) FRAME_TOP_GUTTER_END (f)
768 (FRAME_INTERNAL_BORDER_TOP_EDGE (f) + FRAME_INTERNAL_BORDER_HEIGHT (f)) 765 #ifdef BOTTOM_GUTTER_IS_OUTSIDE_MINIBUFFER
769 #define FRAME_PANED_BOTTOM_EDGE(f) \ 766 #define FRAME_PANED_BOTTOM_EDGE(f) FRAME_BOTTOM_GUTTER_START (f)
770 (FRAME_INTERNAL_BORDER_BOTTOM_EDGE (f) - FRAME_INTERNAL_BORDER_HEIGHT (f)) 767 #endif /* BOTTOM_GUTTER_IS_OUTSIDE_MINIBUFFER */
771 #define FRAME_PANED_LEFT_EDGE(f) \ 768 #define FRAME_PANED_LEFT_EDGE(f) FRAME_LEFT_GUTTER_END (f)
772 (FRAME_INTERNAL_BORDER_LEFT_EDGE (f) + FRAME_INTERNAL_BORDER_WIDTH (f)) 769 #define FRAME_PANED_RIGHT_EDGE(f) FRAME_RIGHT_GUTTER_START (f)
773 #define FRAME_PANED_RIGHT_EDGE(f) \
774 (FRAME_INTERNAL_BORDER_RIGHT_EDGE (f) - FRAME_INTERNAL_BORDER_WIDTH (f))
775 770
776 /* Thickness of non-paned area at edge of frame; 771 /* Thickness of non-paned area at edge of frame;
777 772
778 FRAME_PANED_TOP_EDGE (f) == FRAME_NONPANED_SIZE (f, TOP_EDGE) 773 FRAME_PANED_TOP_EDGE (f) == FRAME_NONPANED_SIZE (f, TOP_EDGE)
779 FRAME_PANED_LEFT_EDGE (f) == FRAME_NONPANED_SIZE (f, LEFT_EDGE) 774 FRAME_PANED_LEFT_EDGE (f) == FRAME_NONPANED_SIZE (f, LEFT_EDGE)
782 FRAME_PANED_RIGHT_EDGE (f) == 777 FRAME_PANED_RIGHT_EDGE (f) ==
783 FRAME_PIXWIDTH (f) - FRAME_NONPANED_SIZE (f, RIGHT_EDGE) 778 FRAME_PIXWIDTH (f) - FRAME_NONPANED_SIZE (f, RIGHT_EDGE)
784 779
785 */ 780 */
786 #define FRAME_NONPANED_SIZE(f, pos) \ 781 #define FRAME_NONPANED_SIZE(f, pos) \
787 (FRAME_REAL_TOOLBAR_BOUNDS (f, pos) + FRAME_GUTTER_BOUNDS (f, pos) + \ 782 (FRAME_REAL_TOOLBAR_BOUNDS (f, pos) + FRAME_INTERNAL_BORDER_SIZE (f, pos) + \
788 FRAME_INTERNAL_BORDER_SIZE (f, pos)) 783 FRAME_GUTTER_BOUNDS (f, pos))
789 784
790 785
791 786
792 #endif /* INCLUDED_frame_impl_h_ */ 787 #endif /* INCLUDED_frame_impl_h_ */