/[emacs]/emacs/src/dispnew.c
ViewVC logotype

Diff of /emacs/src/dispnew.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.304 by gerd, Sat Mar 30 11:55:21 2002 UTC revision 1.305 by gerd, Fri Apr 12 09:36:56 2002 UTC
# Line 5754  mode_line_string (w, x, y, mode_line_p, Line 5754  mode_line_string (w, x, y, mode_line_p,
5754  }  }
5755    
5756    
5757    /* Value is the string under window-relative coordinates X/Y in either
5758       marginal area, or nil if none.  *CHARPOS is set to the position in
5759       the string returned.  */
5760    
5761    Lisp_Object
5762    marginal_area_string (w, x, y, area, charpos)
5763         struct window *w;
5764         int x, y;
5765         int *charpos;
5766         int area;
5767    {
5768      struct glyph_row *row = w->current_matrix->rows;
5769      struct glyph *glyph, *end;
5770      int x0, i, wy = y;
5771      Lisp_Object string = Qnil;
5772    
5773      if (area == 6)
5774        area = LEFT_MARGIN_AREA;
5775      else if (area == 7)
5776        area = RIGHT_MARGIN_AREA;
5777      else
5778        abort ();
5779    
5780      for (i = 0; row->enabled_p && i < w->current_matrix->nrows; ++i, ++row)
5781        if (wy >= row->y && wy < MATRIX_ROW_BOTTOM_Y (row))
5782          break;
5783    
5784      if (row->enabled_p)
5785        {
5786          /* Find the glyph under X.  If we find one with a string object,
5787             it's the one we were looking for.  */
5788          glyph = row->glyphs[area];
5789          end = glyph + row->used[area];
5790          if (area == RIGHT_MARGIN_AREA)
5791            x0 = (window_box_width (w, TEXT_AREA)
5792                  + window_box_width (w, LEFT_MARGIN_AREA));
5793          else
5794            x0 = 0;
5795          for (; glyph < end; x0 += glyph->pixel_width, ++glyph)
5796            if (x >= x0 && x < x0 + glyph->pixel_width)
5797              {
5798                string = glyph->object;
5799                *charpos = glyph->charpos;
5800                break;
5801              }
5802        }
5803    
5804      return string;
5805    }
5806    
5807    
5808  /***********************************************************************  /***********************************************************************
5809                           Changing Frame Sizes                           Changing Frame Sizes
5810   ***********************************************************************/   ***********************************************************************/

Legend:
Removed from v.1.304  
changed lines
  Added in v.1.305

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26