diff 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
line wrap: on
line diff
--- a/src/redisplay.c	Tue Feb 23 07:28:35 2010 -0600
+++ b/src/redisplay.c	Mon Mar 29 21:28:13 2010 -0500
@@ -1686,7 +1686,10 @@
 	  break;
 	case PROP_STRING:
 	  if (pb->data.p_string.str)
-	    xfree (pb->data.p_string.str);
+	    {
+	      xfree (pb->data.p_string.str);
+	      pb->data.p_string.str = 0;
+	    }
 	  /* #### bogus bogus -- this doesn't do anything!
 	     Should probably call add_ibyte_string_runes(),
 	     once that function is fixed. */
@@ -8768,7 +8771,7 @@
     d->pixel_to_glyph_cache.obj_x = *obj_x;				\
     d->pixel_to_glyph_cache.obj_y = *obj_y;				\
     d->pixel_to_glyph_cache.w = *w;					\
-    d->pixel_to_glyph_cache.charpos = *charpos;			\
+    d->pixel_to_glyph_cache.charpos = *charpos;				\
     d->pixel_to_glyph_cache.closest = *closest;				\
     d->pixel_to_glyph_cache.modeline_closest = *modeline_closest;	\
     d->pixel_to_glyph_cache.obj1 = *obj1;				\
@@ -8785,10 +8788,15 @@
      OVER_TOOLBAR:	over one of the 4 frame toolbars
      OVER_MODELINE:	over a modeline
      OVER_BORDER:	over an internal border
+     OVER_V_DIVIDER:    over a vertical divider between windows (used as a
+                        grab bar for resizing)
      OVER_NOTHING:	over the text area, but not over text
      OVER_OUTSIDE:	outside of the frame border
      OVER_TEXT:		over text in the text area
 
+   #### GEOM! We need to also have an OVER_GUTTER, OVER_SCROLLBAR and
+   OVER_DEAD_BOX.
+
    OBJ1 is one of
 
      -- a toolbar button
@@ -8881,25 +8889,28 @@
   if (device_check_failed)
     return OVER_NOTHING;
 
-  frm_left = FRAME_LEFT_BORDER_END (f);
-  frm_right = FRAME_RIGHT_BORDER_START (f);
-  frm_top = FRAME_TOP_BORDER_END (f);
-  frm_bottom = FRAME_BOTTOM_BORDER_START (f);
+  /* #### GEOM! The gutter is just inside of this.  We should also have an
+     OVER_GUTTER return value to indicate that we're over a gutter.  See
+     above. */
+  frm_left = FRAME_LEFT_INTERNAL_BORDER_END (f);
+  frm_right = FRAME_RIGHT_INTERNAL_BORDER_START (f);
+  frm_top = FRAME_TOP_INTERNAL_BORDER_END (f);
+  frm_bottom = FRAME_BOTTOM_INTERNAL_BORDER_START (f);
 
   /* Check if the mouse is outside of the text area actually used by
      redisplay. */
   if (y_coord < frm_top)
     {
-      if (y_coord >= FRAME_TOP_BORDER_START (f))
-	{
-	  low_y_coord = FRAME_TOP_BORDER_START (f);
+      if (y_coord >= FRAME_TOP_INTERNAL_BORDER_START (f))
+	{
+	  low_y_coord = FRAME_TOP_INTERNAL_BORDER_START (f);
 	  high_y_coord = frm_top;
 	  position = OVER_BORDER;
 	}
       else if (y_coord >= 0)
 	{
 	  low_y_coord = 0;
-	  high_y_coord = FRAME_TOP_BORDER_START (f);
+	  high_y_coord = FRAME_TOP_INTERNAL_BORDER_START (f);
 	  position = OVER_TOOLBAR;
 	}
       else
@@ -8911,15 +8922,15 @@
     }
   else if (y_coord >= frm_bottom)
     {
-      if (y_coord < FRAME_BOTTOM_BORDER_END (f))
+      if (y_coord < FRAME_BOTTOM_INTERNAL_BORDER_END (f))
 	{
 	  low_y_coord = frm_bottom;
-	  high_y_coord = FRAME_BOTTOM_BORDER_END (f);
+	  high_y_coord = FRAME_BOTTOM_INTERNAL_BORDER_END (f);
 	  position = OVER_BORDER;
 	}
       else if (y_coord < FRAME_PIXHEIGHT (f))
 	{
-	  low_y_coord = FRAME_BOTTOM_BORDER_END (f);
+	  low_y_coord = FRAME_BOTTOM_INTERNAL_BORDER_END (f);
 	  high_y_coord = FRAME_PIXHEIGHT (f);
 	  position = OVER_TOOLBAR;
 	}
@@ -8935,16 +8946,16 @@
     {
       if (x_coord < frm_left)
 	{
-	  if (x_coord >= FRAME_LEFT_BORDER_START (f))
-	    {
-	      low_x_coord = FRAME_LEFT_BORDER_START (f);
+	  if (x_coord >= FRAME_LEFT_INTERNAL_BORDER_START (f))
+	    {
+	      low_x_coord = FRAME_LEFT_INTERNAL_BORDER_START (f);
 	      high_x_coord = frm_left;
 	      position = OVER_BORDER;
 	    }
 	  else if (x_coord >= 0)
 	    {
 	      low_x_coord = 0;
-	      high_x_coord = FRAME_LEFT_BORDER_START (f);
+	      high_x_coord = FRAME_LEFT_INTERNAL_BORDER_START (f);
 	      position = OVER_TOOLBAR;
 	    }
 	  else
@@ -8956,15 +8967,15 @@
 	}
       else if (x_coord >= frm_right)
 	{
-	  if (x_coord < FRAME_RIGHT_BORDER_END (f))
+	  if (x_coord < FRAME_RIGHT_INTERNAL_BORDER_END (f))
 	    {
 	      low_x_coord = frm_right;
-	      high_x_coord = FRAME_RIGHT_BORDER_END (f);
+	      high_x_coord = FRAME_RIGHT_INTERNAL_BORDER_END (f);
 	      position = OVER_BORDER;
 	    }
 	  else if (x_coord < FRAME_PIXWIDTH (f))
 	    {
-	      low_x_coord = FRAME_RIGHT_BORDER_END (f);
+	      low_x_coord = FRAME_RIGHT_INTERNAL_BORDER_END (f);
 	      high_x_coord = FRAME_PIXWIDTH (f);
 	      position = OVER_TOOLBAR;
 	    }
@@ -9657,50 +9668,50 @@
 /***************************************************************************/
 
 static int
-compute_rune_dynarr_usage (rune_dynarr *dyn, struct overhead_stats *ovstats)
-{
-  return dyn ? Dynarr_memory_usage (dyn, ovstats) : 0;
+compute_rune_dynarr_usage (rune_dynarr *dyn, struct usage_stats *ustats)
+{
+  return dyn ? Dynarr_memory_usage (dyn, ustats) : 0;
 }
 
 static int
 compute_display_block_dynarr_usage (display_block_dynarr *dyn,
-				    struct overhead_stats *ovstats)
+				    struct usage_stats *ustats)
 {
   int total, i;
 
   if (!dyn)
     return 0;
 
-  total = Dynarr_memory_usage (dyn, ovstats);
+  total = Dynarr_memory_usage (dyn, ustats);
   for (i = 0; i < Dynarr_largest (dyn); i++)
-    total += compute_rune_dynarr_usage (Dynarr_at (dyn, i).runes, ovstats);
+    total += compute_rune_dynarr_usage (Dynarr_at (dyn, i).runes, ustats);
 
   return total;
 }
 
 static int
 compute_glyph_block_dynarr_usage (glyph_block_dynarr *dyn,
-				  struct overhead_stats *ovstats)
-{
-  return dyn ? Dynarr_memory_usage (dyn, ovstats) : 0;
+				  struct usage_stats *ustats)
+{
+  return dyn ? Dynarr_memory_usage (dyn, ustats) : 0;
 }
 
 int
 compute_display_line_dynarr_usage (display_line_dynarr *dyn,
-				   struct overhead_stats *ovstats)
+				   struct usage_stats *ustats)
 {
   int total, i;
 
   if (!dyn)
     return 0;
 
-  total = Dynarr_memory_usage (dyn, ovstats);
+  total = Dynarr_memory_usage (dyn, ustats);
   for (i = 0; i < Dynarr_largest (dyn); i++)
     {
       struct display_line *dl = &Dynarr_at (dyn, i);
-      total += compute_display_block_dynarr_usage(dl->display_blocks, ovstats);
-      total += compute_glyph_block_dynarr_usage  (dl->left_glyphs,    ovstats);
-      total += compute_glyph_block_dynarr_usage  (dl->right_glyphs,   ovstats);
+      total += compute_display_block_dynarr_usage(dl->display_blocks, ustats);
+      total += compute_glyph_block_dynarr_usage  (dl->left_glyphs,    ustats);
+      total += compute_glyph_block_dynarr_usage  (dl->right_glyphs,   ustats);
     }
 
   return total;
@@ -9708,9 +9719,9 @@
 
 int
 compute_line_start_cache_dynarr_usage (line_start_cache_dynarr *dyn,
-				       struct overhead_stats *ovstats)
-{
-  return dyn ? Dynarr_memory_usage (dyn, ovstats) : 0;
+				       struct usage_stats *ustats)
+{
+  return dyn ? Dynarr_memory_usage (dyn, ustats) : 0;
 }
 
 #endif /* MEMORY_USAGE_STATS */