Mercurial > hg > xemacs-beta
diff 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 |
line wrap: on
line diff
--- a/src/frame-impl.h Mon Feb 15 22:58:10 2010 -0600 +++ b/src/frame-impl.h Tue Feb 16 01:21:32 2010 -0600 @@ -1,6 +1,6 @@ /* Define frame-object for XEmacs. Copyright (C) 1988, 1992, 1993, 1994 Free Software Foundation, Inc. - Copyright (C) 1995 Ben Wing. + Copyright (C) 1995, 2010 Ben Wing. This file is part of XEmacs. @@ -543,8 +543,16 @@ #endif /* FSFmacs */ -#define FRAME_BORDER_WIDTH(f) ((f)->internal_border_width) -#define FRAME_BORDER_HEIGHT(f) ((f)->internal_border_width) +#define FRAME_INTERNAL_BORDER_WIDTH(f) ((f)->internal_border_width) +#define FRAME_INTERNAL_BORDER_HEIGHT(f) ((f)->internal_border_width) +#define FRAME_INTERNAL_BORDER_SIZE(f, pos) ((f)->internal_border_width) + +/************************************************************************/ +/* toolbars */ +/************************************************************************/ + +/*---------------- Theoretical and real toolbar values ----------------*/ + /* This returns the frame-local value; that tells you what you should use when computing the frame size. It is *not* the actual toolbar @@ -657,6 +665,10 @@ ? FRAME_RAW_REAL_TOOLBAR_BORDER_WIDTH (f, pos) \ : 0) +#define FRAME_REAL_TOOLBAR_BOUNDS(f, pos) \ + (FRAME_REAL_TOOLBAR_SIZE (f, pos) + \ + 2 * FRAME_REAL_TOOLBAR_BORDER_WIDTH (f, pos)) + #define FRAME_REAL_TOP_TOOLBAR_HEIGHT(f) \ FRAME_REAL_TOOLBAR_SIZE (f, TOP_TOOLBAR) #define FRAME_REAL_BOTTOM_TOOLBAR_HEIGHT(f) \ @@ -684,32 +696,39 @@ #define FRAME_REAL_RIGHT_TOOLBAR_VISIBLE(f) \ FRAME_REAL_TOOLBAR_VISIBLE (f, RIGHT_TOOLBAR) +#define FRAME_REAL_TOP_TOOLBAR_BOUNDS(f) \ + FRAME_REAL_TOOLBAR_BOUNDS (f, TOP_TOOLBAR) +#define FRAME_REAL_BOTTOM_TOOLBAR_BOUNDS(f) \ + FRAME_REAL_TOOLBAR_BOUNDS (f, BOTTOM_TOOLBAR) +#define FRAME_REAL_LEFT_TOOLBAR_BOUNDS(f) \ + FRAME_REAL_TOOLBAR_BOUNDS (f, LEFT_TOOLBAR) +#define FRAME_REAL_RIGHT_TOOLBAR_BOUNDS(f) \ + FRAME_REAL_TOOLBAR_BOUNDS (f, RIGHT_TOOLBAR) + +/************************************************************************/ +/* frame dimensions defined using toolbars and gutters */ +/************************************************************************/ + +/* #### These should be using the gutter sizes, but aren't yet */ + #define FRAME_TOP_BORDER_START(f) \ - (FRAME_REAL_TOP_TOOLBAR_HEIGHT (f) + \ - 2 * FRAME_REAL_TOP_TOOLBAR_BORDER_WIDTH (f)) + FRAME_REAL_TOP_TOOLBAR_BOUNDS (f) #define FRAME_TOP_BORDER_END(f) \ - (FRAME_TOP_BORDER_START (f) + FRAME_BORDER_HEIGHT (f)) + (FRAME_TOP_BORDER_START (f) + FRAME_INTERNAL_BORDER_HEIGHT (f)) #define FRAME_BOTTOM_BORDER_START(f) \ - (FRAME_PIXHEIGHT (f) - FRAME_BORDER_HEIGHT (f) - \ - FRAME_REAL_BOTTOM_TOOLBAR_HEIGHT (f) - \ - 2 * FRAME_REAL_BOTTOM_TOOLBAR_BORDER_WIDTH (f)) + (FRAME_BOTTOM_BORDER_END (f) - FRAME_INTERNAL_BORDER_HEIGHT (f)) #define FRAME_BOTTOM_BORDER_END(f) \ - (FRAME_PIXHEIGHT (f) - FRAME_REAL_BOTTOM_TOOLBAR_HEIGHT (f) - \ - 2 * FRAME_REAL_BOTTOM_TOOLBAR_BORDER_WIDTH (f)) + (FRAME_PIXHEIGHT (f) - FRAME_REAL_BOTTOM_TOOLBAR_BOUNDS (f)) #define FRAME_LEFT_BORDER_START(f) \ - (FRAME_REAL_LEFT_TOOLBAR_WIDTH (f) + \ - 2 * FRAME_REAL_LEFT_TOOLBAR_BORDER_WIDTH (f)) + FRAME_REAL_LEFT_TOOLBAR_BOUNDS (f) #define FRAME_LEFT_BORDER_END(f) \ - (FRAME_LEFT_BORDER_START (f) + FRAME_BORDER_WIDTH (f)) + (FRAME_LEFT_BORDER_START (f) + FRAME_INTERNAL_BORDER_WIDTH (f)) #define FRAME_RIGHT_BORDER_START(f) \ - (FRAME_PIXWIDTH (f) - FRAME_BORDER_WIDTH (f) - \ - FRAME_REAL_RIGHT_TOOLBAR_WIDTH(f) - \ - 2 * FRAME_REAL_RIGHT_TOOLBAR_BORDER_WIDTH (f)) + (FRAME_RIGHT_BORDER_END (f) - FRAME_INTERNAL_BORDER_WIDTH (f)) #define FRAME_RIGHT_BORDER_END(f) \ - (FRAME_PIXWIDTH (f) - FRAME_REAL_RIGHT_TOOLBAR_WIDTH (f) - \ - 2 * FRAME_REAL_RIGHT_TOOLBAR_BORDER_WIDTH(f)) + (FRAME_PIXWIDTH (f) - FRAME_REAL_RIGHT_TOOLBAR_BOUNDS (f)) #endif /* INCLUDED_frame_impl_h_ */