X-Git-Url: http://git.chise.org/gitweb/?p=chise%2Fxemacs-chise.git.1;a=blobdiff_plain;f=src%2Fgutter.c;h=c25058911051e504e6f7893731875aa68594ae9f;hp=72fb052bc50685662f489e40e0f40763126e35f9;hb=82f6d62ee211b1d36e8f45fed3ee3edde82b6916;hpb=a40368ea9486a5da02004feb1254b9cceb857228 diff --git a/src/gutter.c b/src/gutter.c index 72fb052..c250589 100644 --- a/src/gutter.c +++ b/src/gutter.c @@ -218,6 +218,41 @@ get_gutter_coords (struct frame *f, enum gutter_pos pos, int *x, int *y, } } +/* + 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" :