[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFA] Console based mouse face highlighting.

From: Nick Roberts
Subject: Re: [RFA] Console based mouse face highlighting.
Date: Wed, 16 May 2007 22:00:52 +1200

 >                                     ...However I don't think declaring a new
 > struct glyph_row varable would save much.  I'm not sure what else I could
 > do.

Actually I can do better than this, as below, which doesn't modify the glyph
matrix and does indeed eliminate some problems.

OK to apply now?

Nick                                           http://www.inet.net.nz/~nickrob

       term_show_mouse_face (draw)
       loop ...

          if (draw == DRAW_MOUSE_FACE)
              glyph = xmalloc (nglyphs * sizeof (struct glyph));
              memcpy (glyph, row->glyphs[TEXT_AREA] + start_hpos,
                      nglyphs * sizeof (struct glyph));
              for (j = 0; j < nglyphs; j = j++)
                  (glyph + j)->face_id = mouse_face_face_id;
          else /* draw == DRAW_NORMAL_TEXT */
              glyph = row->glyphs[TEXT_AREA] + start_hpos;

          pos_y = row->y + WINDOW_TOP_EDGE_Y (w);
          pos_x = row->used[LEFT_MARGIN_AREA] + start_hpos
            + WINDOW_LEFT_EDGE_X (w);
          cursor_to (pos_y, pos_x);
          write_glyphs (glyph, nglyphs);
          if (draw == DRAW_MOUSE_FACE)
            xfree (glyph);
      cursor_to (save_y, save_x);

reply via email to

[Prev in Thread] Current Thread [Next in Thread]