comparison src/redisplay.c @ 5178:97eb4942aec8

merge
author Ben Wing <ben@xemacs.org>
date Mon, 29 Mar 2010 21:28:13 -0500
parents 8b2f75cecb89 6c6d78781d59
children bc3ede8f29a8
comparison
equal deleted inserted replaced
5177:b785049378e3 5178:97eb4942aec8
1684 if (add_failed) 1684 if (add_failed)
1685 goto oops_no_more_space; 1685 goto oops_no_more_space;
1686 break; 1686 break;
1687 case PROP_STRING: 1687 case PROP_STRING:
1688 if (pb->data.p_string.str) 1688 if (pb->data.p_string.str)
1689 xfree (pb->data.p_string.str); 1689 {
1690 xfree (pb->data.p_string.str);
1691 pb->data.p_string.str = 0;
1692 }
1690 /* #### bogus bogus -- this doesn't do anything! 1693 /* #### bogus bogus -- this doesn't do anything!
1691 Should probably call add_ibyte_string_runes(), 1694 Should probably call add_ibyte_string_runes(),
1692 once that function is fixed. */ 1695 once that function is fixed. */
1693 break; 1696 break;
1694 case PROP_MINIBUF_PROMPT: 1697 case PROP_MINIBUF_PROMPT:
8766 d->pixel_to_glyph_cache.col = *col; \ 8769 d->pixel_to_glyph_cache.col = *col; \
8767 d->pixel_to_glyph_cache.row = *row; \ 8770 d->pixel_to_glyph_cache.row = *row; \
8768 d->pixel_to_glyph_cache.obj_x = *obj_x; \ 8771 d->pixel_to_glyph_cache.obj_x = *obj_x; \
8769 d->pixel_to_glyph_cache.obj_y = *obj_y; \ 8772 d->pixel_to_glyph_cache.obj_y = *obj_y; \
8770 d->pixel_to_glyph_cache.w = *w; \ 8773 d->pixel_to_glyph_cache.w = *w; \
8771 d->pixel_to_glyph_cache.charpos = *charpos; \ 8774 d->pixel_to_glyph_cache.charpos = *charpos; \
8772 d->pixel_to_glyph_cache.closest = *closest; \ 8775 d->pixel_to_glyph_cache.closest = *closest; \
8773 d->pixel_to_glyph_cache.modeline_closest = *modeline_closest; \ 8776 d->pixel_to_glyph_cache.modeline_closest = *modeline_closest; \
8774 d->pixel_to_glyph_cache.obj1 = *obj1; \ 8777 d->pixel_to_glyph_cache.obj1 = *obj1; \
8775 d->pixel_to_glyph_cache.obj2 = *obj2; \ 8778 d->pixel_to_glyph_cache.obj2 = *obj2; \
8776 d->pixel_to_glyph_cache.retval = position; \ 8779 d->pixel_to_glyph_cache.retval = position; \
8783 The return value will be one of: 8786 The return value will be one of:
8784 8787
8785 OVER_TOOLBAR: over one of the 4 frame toolbars 8788 OVER_TOOLBAR: over one of the 4 frame toolbars
8786 OVER_MODELINE: over a modeline 8789 OVER_MODELINE: over a modeline
8787 OVER_BORDER: over an internal border 8790 OVER_BORDER: over an internal border
8791 OVER_V_DIVIDER: over a vertical divider between windows (used as a
8792 grab bar for resizing)
8788 OVER_NOTHING: over the text area, but not over text 8793 OVER_NOTHING: over the text area, but not over text
8789 OVER_OUTSIDE: outside of the frame border 8794 OVER_OUTSIDE: outside of the frame border
8790 OVER_TEXT: over text in the text area 8795 OVER_TEXT: over text in the text area
8796
8797 #### GEOM! We need to also have an OVER_GUTTER, OVER_SCROLLBAR and
8798 OVER_DEAD_BOX.
8791 8799
8792 OBJ1 is one of 8800 OBJ1 is one of
8793 8801
8794 -- a toolbar button 8802 -- a toolbar button
8795 -- a glyph 8803 -- a glyph
8879 } 8887 }
8880 8888
8881 if (device_check_failed) 8889 if (device_check_failed)
8882 return OVER_NOTHING; 8890 return OVER_NOTHING;
8883 8891
8884 frm_left = FRAME_LEFT_BORDER_END (f); 8892 /* #### GEOM! The gutter is just inside of this. We should also have an
8885 frm_right = FRAME_RIGHT_BORDER_START (f); 8893 OVER_GUTTER return value to indicate that we're over a gutter. See
8886 frm_top = FRAME_TOP_BORDER_END (f); 8894 above. */
8887 frm_bottom = FRAME_BOTTOM_BORDER_START (f); 8895 frm_left = FRAME_LEFT_INTERNAL_BORDER_END (f);
8896 frm_right = FRAME_RIGHT_INTERNAL_BORDER_START (f);
8897 frm_top = FRAME_TOP_INTERNAL_BORDER_END (f);
8898 frm_bottom = FRAME_BOTTOM_INTERNAL_BORDER_START (f);
8888 8899
8889 /* Check if the mouse is outside of the text area actually used by 8900 /* Check if the mouse is outside of the text area actually used by
8890 redisplay. */ 8901 redisplay. */
8891 if (y_coord < frm_top) 8902 if (y_coord < frm_top)
8892 { 8903 {
8893 if (y_coord >= FRAME_TOP_BORDER_START (f)) 8904 if (y_coord >= FRAME_TOP_INTERNAL_BORDER_START (f))
8894 { 8905 {
8895 low_y_coord = FRAME_TOP_BORDER_START (f); 8906 low_y_coord = FRAME_TOP_INTERNAL_BORDER_START (f);
8896 high_y_coord = frm_top; 8907 high_y_coord = frm_top;
8897 position = OVER_BORDER; 8908 position = OVER_BORDER;
8898 } 8909 }
8899 else if (y_coord >= 0) 8910 else if (y_coord >= 0)
8900 { 8911 {
8901 low_y_coord = 0; 8912 low_y_coord = 0;
8902 high_y_coord = FRAME_TOP_BORDER_START (f); 8913 high_y_coord = FRAME_TOP_INTERNAL_BORDER_START (f);
8903 position = OVER_TOOLBAR; 8914 position = OVER_TOOLBAR;
8904 } 8915 }
8905 else 8916 else
8906 { 8917 {
8907 low_y_coord = y_coord; 8918 low_y_coord = y_coord;
8909 position = OVER_OUTSIDE; 8920 position = OVER_OUTSIDE;
8910 } 8921 }
8911 } 8922 }
8912 else if (y_coord >= frm_bottom) 8923 else if (y_coord >= frm_bottom)
8913 { 8924 {
8914 if (y_coord < FRAME_BOTTOM_BORDER_END (f)) 8925 if (y_coord < FRAME_BOTTOM_INTERNAL_BORDER_END (f))
8915 { 8926 {
8916 low_y_coord = frm_bottom; 8927 low_y_coord = frm_bottom;
8917 high_y_coord = FRAME_BOTTOM_BORDER_END (f); 8928 high_y_coord = FRAME_BOTTOM_INTERNAL_BORDER_END (f);
8918 position = OVER_BORDER; 8929 position = OVER_BORDER;
8919 } 8930 }
8920 else if (y_coord < FRAME_PIXHEIGHT (f)) 8931 else if (y_coord < FRAME_PIXHEIGHT (f))
8921 { 8932 {
8922 low_y_coord = FRAME_BOTTOM_BORDER_END (f); 8933 low_y_coord = FRAME_BOTTOM_INTERNAL_BORDER_END (f);
8923 high_y_coord = FRAME_PIXHEIGHT (f); 8934 high_y_coord = FRAME_PIXHEIGHT (f);
8924 position = OVER_TOOLBAR; 8935 position = OVER_TOOLBAR;
8925 } 8936 }
8926 else 8937 else
8927 { 8938 {
8933 8944
8934 if (position != OVER_TOOLBAR && position != OVER_BORDER) 8945 if (position != OVER_TOOLBAR && position != OVER_BORDER)
8935 { 8946 {
8936 if (x_coord < frm_left) 8947 if (x_coord < frm_left)
8937 { 8948 {
8938 if (x_coord >= FRAME_LEFT_BORDER_START (f)) 8949 if (x_coord >= FRAME_LEFT_INTERNAL_BORDER_START (f))
8939 { 8950 {
8940 low_x_coord = FRAME_LEFT_BORDER_START (f); 8951 low_x_coord = FRAME_LEFT_INTERNAL_BORDER_START (f);
8941 high_x_coord = frm_left; 8952 high_x_coord = frm_left;
8942 position = OVER_BORDER; 8953 position = OVER_BORDER;
8943 } 8954 }
8944 else if (x_coord >= 0) 8955 else if (x_coord >= 0)
8945 { 8956 {
8946 low_x_coord = 0; 8957 low_x_coord = 0;
8947 high_x_coord = FRAME_LEFT_BORDER_START (f); 8958 high_x_coord = FRAME_LEFT_INTERNAL_BORDER_START (f);
8948 position = OVER_TOOLBAR; 8959 position = OVER_TOOLBAR;
8949 } 8960 }
8950 else 8961 else
8951 { 8962 {
8952 low_x_coord = x_coord; 8963 low_x_coord = x_coord;
8954 position = OVER_OUTSIDE; 8965 position = OVER_OUTSIDE;
8955 } 8966 }
8956 } 8967 }
8957 else if (x_coord >= frm_right) 8968 else if (x_coord >= frm_right)
8958 { 8969 {
8959 if (x_coord < FRAME_RIGHT_BORDER_END (f)) 8970 if (x_coord < FRAME_RIGHT_INTERNAL_BORDER_END (f))
8960 { 8971 {
8961 low_x_coord = frm_right; 8972 low_x_coord = frm_right;
8962 high_x_coord = FRAME_RIGHT_BORDER_END (f); 8973 high_x_coord = FRAME_RIGHT_INTERNAL_BORDER_END (f);
8963 position = OVER_BORDER; 8974 position = OVER_BORDER;
8964 } 8975 }
8965 else if (x_coord < FRAME_PIXWIDTH (f)) 8976 else if (x_coord < FRAME_PIXWIDTH (f))
8966 { 8977 {
8967 low_x_coord = FRAME_RIGHT_BORDER_END (f); 8978 low_x_coord = FRAME_RIGHT_INTERNAL_BORDER_END (f);
8968 high_x_coord = FRAME_PIXWIDTH (f); 8979 high_x_coord = FRAME_PIXWIDTH (f);
8969 position = OVER_TOOLBAR; 8980 position = OVER_TOOLBAR;
8970 } 8981 }
8971 else 8982 else
8972 { 8983 {
9655 /* memory usage computation */ 9666 /* memory usage computation */
9656 /* */ 9667 /* */
9657 /***************************************************************************/ 9668 /***************************************************************************/
9658 9669
9659 static int 9670 static int
9660 compute_rune_dynarr_usage (rune_dynarr *dyn, struct overhead_stats *ovstats) 9671 compute_rune_dynarr_usage (rune_dynarr *dyn, struct usage_stats *ustats)
9661 { 9672 {
9662 return dyn ? Dynarr_memory_usage (dyn, ovstats) : 0; 9673 return dyn ? Dynarr_memory_usage (dyn, ustats) : 0;
9663 } 9674 }
9664 9675
9665 static int 9676 static int
9666 compute_display_block_dynarr_usage (display_block_dynarr *dyn, 9677 compute_display_block_dynarr_usage (display_block_dynarr *dyn,
9667 struct overhead_stats *ovstats) 9678 struct usage_stats *ustats)
9668 { 9679 {
9669 int total, i; 9680 int total, i;
9670 9681
9671 if (!dyn) 9682 if (!dyn)
9672 return 0; 9683 return 0;
9673 9684
9674 total = Dynarr_memory_usage (dyn, ovstats); 9685 total = Dynarr_memory_usage (dyn, ustats);
9675 for (i = 0; i < Dynarr_largest (dyn); i++) 9686 for (i = 0; i < Dynarr_largest (dyn); i++)
9676 total += compute_rune_dynarr_usage (Dynarr_at (dyn, i).runes, ovstats); 9687 total += compute_rune_dynarr_usage (Dynarr_at (dyn, i).runes, ustats);
9677 9688
9678 return total; 9689 return total;
9679 } 9690 }
9680 9691
9681 static int 9692 static int
9682 compute_glyph_block_dynarr_usage (glyph_block_dynarr *dyn, 9693 compute_glyph_block_dynarr_usage (glyph_block_dynarr *dyn,
9683 struct overhead_stats *ovstats) 9694 struct usage_stats *ustats)
9684 { 9695 {
9685 return dyn ? Dynarr_memory_usage (dyn, ovstats) : 0; 9696 return dyn ? Dynarr_memory_usage (dyn, ustats) : 0;
9686 } 9697 }
9687 9698
9688 int 9699 int
9689 compute_display_line_dynarr_usage (display_line_dynarr *dyn, 9700 compute_display_line_dynarr_usage (display_line_dynarr *dyn,
9690 struct overhead_stats *ovstats) 9701 struct usage_stats *ustats)
9691 { 9702 {
9692 int total, i; 9703 int total, i;
9693 9704
9694 if (!dyn) 9705 if (!dyn)
9695 return 0; 9706 return 0;
9696 9707
9697 total = Dynarr_memory_usage (dyn, ovstats); 9708 total = Dynarr_memory_usage (dyn, ustats);
9698 for (i = 0; i < Dynarr_largest (dyn); i++) 9709 for (i = 0; i < Dynarr_largest (dyn); i++)
9699 { 9710 {
9700 struct display_line *dl = &Dynarr_at (dyn, i); 9711 struct display_line *dl = &Dynarr_at (dyn, i);
9701 total += compute_display_block_dynarr_usage(dl->display_blocks, ovstats); 9712 total += compute_display_block_dynarr_usage(dl->display_blocks, ustats);
9702 total += compute_glyph_block_dynarr_usage (dl->left_glyphs, ovstats); 9713 total += compute_glyph_block_dynarr_usage (dl->left_glyphs, ustats);
9703 total += compute_glyph_block_dynarr_usage (dl->right_glyphs, ovstats); 9714 total += compute_glyph_block_dynarr_usage (dl->right_glyphs, ustats);
9704 } 9715 }
9705 9716
9706 return total; 9717 return total;
9707 } 9718 }
9708 9719
9709 int 9720 int
9710 compute_line_start_cache_dynarr_usage (line_start_cache_dynarr *dyn, 9721 compute_line_start_cache_dynarr_usage (line_start_cache_dynarr *dyn,
9711 struct overhead_stats *ovstats) 9722 struct usage_stats *ustats)
9712 { 9723 {
9713 return dyn ? Dynarr_memory_usage (dyn, ovstats) : 0; 9724 return dyn ? Dynarr_memory_usage (dyn, ustats) : 0;
9714 } 9725 }
9715 9726
9716 #endif /* MEMORY_USAGE_STATS */ 9727 #endif /* MEMORY_USAGE_STATS */
9717 9728
9718 #ifdef ERROR_CHECK_DISPLAY 9729 #ifdef ERROR_CHECK_DISPLAY