Mercurial > hg > xemacs-beta
comparison src/redisplay.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 | 548f1f47eb82 |
children | 1fae11d56ad2 |
comparison
equal
deleted
inserted
replaced
5080:5502045ec510 | 5090:0ca81354c4c7 |
---|---|
8766 d->pixel_to_glyph_cache.col = *col; \ | 8766 d->pixel_to_glyph_cache.col = *col; \ |
8767 d->pixel_to_glyph_cache.row = *row; \ | 8767 d->pixel_to_glyph_cache.row = *row; \ |
8768 d->pixel_to_glyph_cache.obj_x = *obj_x; \ | 8768 d->pixel_to_glyph_cache.obj_x = *obj_x; \ |
8769 d->pixel_to_glyph_cache.obj_y = *obj_y; \ | 8769 d->pixel_to_glyph_cache.obj_y = *obj_y; \ |
8770 d->pixel_to_glyph_cache.w = *w; \ | 8770 d->pixel_to_glyph_cache.w = *w; \ |
8771 d->pixel_to_glyph_cache.charpos = *charpos; \ | 8771 d->pixel_to_glyph_cache.charpos = *charpos; \ |
8772 d->pixel_to_glyph_cache.closest = *closest; \ | 8772 d->pixel_to_glyph_cache.closest = *closest; \ |
8773 d->pixel_to_glyph_cache.modeline_closest = *modeline_closest; \ | 8773 d->pixel_to_glyph_cache.modeline_closest = *modeline_closest; \ |
8774 d->pixel_to_glyph_cache.obj1 = *obj1; \ | 8774 d->pixel_to_glyph_cache.obj1 = *obj1; \ |
8775 d->pixel_to_glyph_cache.obj2 = *obj2; \ | 8775 d->pixel_to_glyph_cache.obj2 = *obj2; \ |
8776 d->pixel_to_glyph_cache.retval = position; \ | 8776 d->pixel_to_glyph_cache.retval = position; \ |
8783 The return value will be one of: | 8783 The return value will be one of: |
8784 | 8784 |
8785 OVER_TOOLBAR: over one of the 4 frame toolbars | 8785 OVER_TOOLBAR: over one of the 4 frame toolbars |
8786 OVER_MODELINE: over a modeline | 8786 OVER_MODELINE: over a modeline |
8787 OVER_BORDER: over an internal border | 8787 OVER_BORDER: over an internal border |
8788 OVER_V_DIVIDER: over a vertical divider between windows (used as a | |
8789 grab bar for resizing) | |
8788 OVER_NOTHING: over the text area, but not over text | 8790 OVER_NOTHING: over the text area, but not over text |
8789 OVER_OUTSIDE: outside of the frame border | 8791 OVER_OUTSIDE: outside of the frame border |
8790 OVER_TEXT: over text in the text area | 8792 OVER_TEXT: over text in the text area |
8793 | |
8794 #### GEOM! We need to also have an OVER_GUTTER, OVER_SCROLLBAR and | |
8795 OVER_DEAD_BOX. | |
8791 | 8796 |
8792 OBJ1 is one of | 8797 OBJ1 is one of |
8793 | 8798 |
8794 -- a toolbar button | 8799 -- a toolbar button |
8795 -- a glyph | 8800 -- a glyph |
8879 } | 8884 } |
8880 | 8885 |
8881 if (device_check_failed) | 8886 if (device_check_failed) |
8882 return OVER_NOTHING; | 8887 return OVER_NOTHING; |
8883 | 8888 |
8884 frm_left = FRAME_LEFT_BORDER_END (f); | 8889 /* #### GEOM! The gutter is just inside of this. We should also have an |
8885 frm_right = FRAME_RIGHT_BORDER_START (f); | 8890 OVER_GUTTER return value to indicate that we're over a gutter. See |
8886 frm_top = FRAME_TOP_BORDER_END (f); | 8891 above. */ |
8887 frm_bottom = FRAME_BOTTOM_BORDER_START (f); | 8892 frm_left = FRAME_LEFT_INTERNAL_BORDER_END (f); |
8893 frm_right = FRAME_RIGHT_INTERNAL_BORDER_START (f); | |
8894 frm_top = FRAME_TOP_INTERNAL_BORDER_END (f); | |
8895 frm_bottom = FRAME_BOTTOM_INTERNAL_BORDER_START (f); | |
8888 | 8896 |
8889 /* Check if the mouse is outside of the text area actually used by | 8897 /* Check if the mouse is outside of the text area actually used by |
8890 redisplay. */ | 8898 redisplay. */ |
8891 if (y_coord < frm_top) | 8899 if (y_coord < frm_top) |
8892 { | 8900 { |
8893 if (y_coord >= FRAME_TOP_BORDER_START (f)) | 8901 if (y_coord >= FRAME_TOP_INTERNAL_BORDER_START (f)) |
8894 { | 8902 { |
8895 low_y_coord = FRAME_TOP_BORDER_START (f); | 8903 low_y_coord = FRAME_TOP_INTERNAL_BORDER_START (f); |
8896 high_y_coord = frm_top; | 8904 high_y_coord = frm_top; |
8897 position = OVER_BORDER; | 8905 position = OVER_BORDER; |
8898 } | 8906 } |
8899 else if (y_coord >= 0) | 8907 else if (y_coord >= 0) |
8900 { | 8908 { |
8901 low_y_coord = 0; | 8909 low_y_coord = 0; |
8902 high_y_coord = FRAME_TOP_BORDER_START (f); | 8910 high_y_coord = FRAME_TOP_INTERNAL_BORDER_START (f); |
8903 position = OVER_TOOLBAR; | 8911 position = OVER_TOOLBAR; |
8904 } | 8912 } |
8905 else | 8913 else |
8906 { | 8914 { |
8907 low_y_coord = y_coord; | 8915 low_y_coord = y_coord; |
8909 position = OVER_OUTSIDE; | 8917 position = OVER_OUTSIDE; |
8910 } | 8918 } |
8911 } | 8919 } |
8912 else if (y_coord >= frm_bottom) | 8920 else if (y_coord >= frm_bottom) |
8913 { | 8921 { |
8914 if (y_coord < FRAME_BOTTOM_BORDER_END (f)) | 8922 if (y_coord < FRAME_BOTTOM_INTERNAL_BORDER_END (f)) |
8915 { | 8923 { |
8916 low_y_coord = frm_bottom; | 8924 low_y_coord = frm_bottom; |
8917 high_y_coord = FRAME_BOTTOM_BORDER_END (f); | 8925 high_y_coord = FRAME_BOTTOM_INTERNAL_BORDER_END (f); |
8918 position = OVER_BORDER; | 8926 position = OVER_BORDER; |
8919 } | 8927 } |
8920 else if (y_coord < FRAME_PIXHEIGHT (f)) | 8928 else if (y_coord < FRAME_PIXHEIGHT (f)) |
8921 { | 8929 { |
8922 low_y_coord = FRAME_BOTTOM_BORDER_END (f); | 8930 low_y_coord = FRAME_BOTTOM_INTERNAL_BORDER_END (f); |
8923 high_y_coord = FRAME_PIXHEIGHT (f); | 8931 high_y_coord = FRAME_PIXHEIGHT (f); |
8924 position = OVER_TOOLBAR; | 8932 position = OVER_TOOLBAR; |
8925 } | 8933 } |
8926 else | 8934 else |
8927 { | 8935 { |
8933 | 8941 |
8934 if (position != OVER_TOOLBAR && position != OVER_BORDER) | 8942 if (position != OVER_TOOLBAR && position != OVER_BORDER) |
8935 { | 8943 { |
8936 if (x_coord < frm_left) | 8944 if (x_coord < frm_left) |
8937 { | 8945 { |
8938 if (x_coord >= FRAME_LEFT_BORDER_START (f)) | 8946 if (x_coord >= FRAME_LEFT_INTERNAL_BORDER_START (f)) |
8939 { | 8947 { |
8940 low_x_coord = FRAME_LEFT_BORDER_START (f); | 8948 low_x_coord = FRAME_LEFT_INTERNAL_BORDER_START (f); |
8941 high_x_coord = frm_left; | 8949 high_x_coord = frm_left; |
8942 position = OVER_BORDER; | 8950 position = OVER_BORDER; |
8943 } | 8951 } |
8944 else if (x_coord >= 0) | 8952 else if (x_coord >= 0) |
8945 { | 8953 { |
8946 low_x_coord = 0; | 8954 low_x_coord = 0; |
8947 high_x_coord = FRAME_LEFT_BORDER_START (f); | 8955 high_x_coord = FRAME_LEFT_INTERNAL_BORDER_START (f); |
8948 position = OVER_TOOLBAR; | 8956 position = OVER_TOOLBAR; |
8949 } | 8957 } |
8950 else | 8958 else |
8951 { | 8959 { |
8952 low_x_coord = x_coord; | 8960 low_x_coord = x_coord; |
8954 position = OVER_OUTSIDE; | 8962 position = OVER_OUTSIDE; |
8955 } | 8963 } |
8956 } | 8964 } |
8957 else if (x_coord >= frm_right) | 8965 else if (x_coord >= frm_right) |
8958 { | 8966 { |
8959 if (x_coord < FRAME_RIGHT_BORDER_END (f)) | 8967 if (x_coord < FRAME_RIGHT_INTERNAL_BORDER_END (f)) |
8960 { | 8968 { |
8961 low_x_coord = frm_right; | 8969 low_x_coord = frm_right; |
8962 high_x_coord = FRAME_RIGHT_BORDER_END (f); | 8970 high_x_coord = FRAME_RIGHT_INTERNAL_BORDER_END (f); |
8963 position = OVER_BORDER; | 8971 position = OVER_BORDER; |
8964 } | 8972 } |
8965 else if (x_coord < FRAME_PIXWIDTH (f)) | 8973 else if (x_coord < FRAME_PIXWIDTH (f)) |
8966 { | 8974 { |
8967 low_x_coord = FRAME_RIGHT_BORDER_END (f); | 8975 low_x_coord = FRAME_RIGHT_INTERNAL_BORDER_END (f); |
8968 high_x_coord = FRAME_PIXWIDTH (f); | 8976 high_x_coord = FRAME_PIXWIDTH (f); |
8969 position = OVER_TOOLBAR; | 8977 position = OVER_TOOLBAR; |
8970 } | 8978 } |
8971 else | 8979 else |
8972 { | 8980 { |