(U+6215): Apply new conventions for glyph granularity.
[chise/xemacs-chise.git.1] / src / gutter.c
index 72fb052..fe6301a 100644 (file)
@@ -70,7 +70,7 @@ update_gutter_geometry (struct frame *f, enum gutter_pos pos);
        (frame)->right_gutter_was_visible = flag;       \
        break;                                          \
       default:                                         \
-       abort ();                                       \
+       ABORT ();                                       \
       }                                                        \
   } while (0)
 
@@ -87,7 +87,7 @@ static int gutter_was_visible (struct frame* frame, enum gutter_pos pos)
     case RIGHT_GUTTER:
       return frame->right_gutter_was_visible;
     default:
-      abort ();
+      ABORT ();
        return 0;       /* To keep the compiler happy */
     }
 }
@@ -214,10 +214,45 @@ get_gutter_coords (struct frame *f, enum gutter_pos pos, int *x, int *y,
       break;
 
     default:
-      abort ();
+      ABORT ();
     }
 }
 
+/*
+ display_boxes_in_gutter_p
+
+ Determine whether the required display_glyph_area is completely
+ inside the gutter. -1 means the display_box is not in the gutter. 1
+ means the display_box and the display_glyph_area are in the
+ window. 0 means the display_box is in the gutter but the
+ display_glyph_area is not. */
+int display_boxes_in_gutter_p (struct frame *f, struct display_box* db,
+                              struct display_glyph_area* dga)
+{
+  enum gutter_pos pos;
+  GUTTER_POS_LOOP (pos)
+    {
+      if (FRAME_GUTTER_VISIBLE (f, pos))
+       {
+         int x, y, width, height;
+         get_gutter_coords (f, pos, &x, &y, &width, &height);
+         if (db->xpos + dga->xoffset >= x
+             &&
+             db->ypos + dga->yoffset >= y
+             &&
+             db->xpos + dga->xoffset + dga->width <= x + width
+             &&
+             db->ypos + dga->yoffset + dga->height <= y + height)
+           return 1;
+         else if (db->xpos >= x && db->ypos >= y
+                  && db->xpos + db->width <= x + width
+                  && db->ypos + db->height <= y + height)
+           return 0;
+       }
+    }
+  return -1;
+}
+
 /* Convert the gutter specifier into something we can actually
    display. */
 static Lisp_Object construct_window_gutter_spec (struct window* w,
@@ -389,7 +424,8 @@ output_gutter (struct frame *f, enum gutter_pos pos, int force)
       (f->extents_changed && w->gutter_extent_modiff[pos]))
     {
 #ifdef DEBUG_GUTTERS
-      printf ("gutter redisplay triggered by %s\n", force ? "force" :
+      printf ("gutter redisplay [%dx%d@%d+%d] triggered by %s,\n", 
+             width, height, x, y, force ? "force" :
              f->faces_changed ? "f->faces_changed" :
              f->frame_changed ? "f->frame_changed" :
              f->gutter_changed ? "f->gutter_changed" :
@@ -549,6 +585,7 @@ update_gutter_geometry (struct frame *f, enum gutter_pos pos)
       pixel_to_char_size (f, FRAME_PIXWIDTH (f), FRAME_PIXHEIGHT (f),
                          &width, &height);
       change_frame_size (f, height, width, 0);
+      MARK_FRAME_LAYOUT_CHANGED (f);
     }
 
   /* Mark sizes as up-to-date. */
@@ -558,7 +595,9 @@ update_gutter_geometry (struct frame *f, enum gutter_pos pos)
 void
 update_frame_gutter_geometry (struct frame *f)
 {
-  if (f->gutter_changed || f->windows_structure_changed)
+  if (f->gutter_changed 
+      || f->frame_layout_changed 
+      || f->windows_structure_changed)
     {
       enum gutter_pos pos;
 
@@ -580,7 +619,7 @@ update_frame_gutters (struct frame *f)
       f->gutter_changed || f->glyphs_changed ||
       f->size_changed || f->subwindows_changed ||
       f->windows_changed || f->windows_structure_changed ||
-      f->extents_changed)
+      f->extents_changed || f->frame_layout_changed)
     {
       enum gutter_pos pos;
 
@@ -1357,6 +1396,9 @@ See `default-gutter-height' for more information.
 #ifdef HAVE_TTY
   fb = Fcons (Fcons (list1 (Qtty), Qautodetect), fb);
 #endif
+#ifdef HAVE_GTK
+  fb = Fcons (Fcons (list1 (Qgtk), Qautodetect), fb);
+#endif
 #ifdef HAVE_X_WINDOWS
   fb = Fcons (Fcons (list1 (Qx), Qautodetect), fb);
 #endif
@@ -1374,6 +1416,9 @@ See `default-gutter-height' for more information.
 #ifdef HAVE_X_WINDOWS
   fb = Fcons (Fcons (list1 (Qx), Qautodetect), fb);
 #endif
+#ifdef HAVE_GTK
+  fb = Fcons (Fcons (list1 (Qgtk), Qautodetect), fb);
+#endif
 #ifdef HAVE_MS_WINDOWS
   fb = Fcons (Fcons (list1 (Qmsprinter), Qautodetect), fb);
   fb = Fcons (Fcons (list1 (Qmswindows), Qautodetect), fb);