emacs-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] Console based mouse face highlighting.


From: Nick Roberts
Subject: Re: [PATCH] Console based mouse face highlighting.
Date: Tue, 15 May 2007 15:53:16 +1200

 > I think curX and curY store the current location of the cursor.  They
 > are updated in cm.c.

OK, thanks.  Is cursor movement expensive on GNU/Linux?  If not, I would do
something like below in term_show_mouse_face.  That would just leave drawing
the highlighting where I've now put TODO (previously I manipulated write_glyphs
to use mouse_face_face_id but that was probably wrong).  msdos.c uses:

          IT_set_face (dpyinfo->mouse_face_face_id);
          _farsetsel (_dos_ds);
          while (nglyphs--)
            {
              _farnspokeb (offset, ScreenAttrib);
              offset += 2;
            }
          if (screen_virtual_segment)
            dosv_refresh_virtual_screen (start_offset, end_hpos - start_hpos);


Can I write directly to the screen like this in term.c?  Or do I have to modify
the current glyph matrix somehow? (Which might be what xdisp.c does.)

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


>From term_show_mouse_face in my term.c:


          if(draw_mouse_face == DRAW_MOUSE_FACE)
            {
              //TODO
            }
          else /* draw_mouse_face == DRAW_NORMAL_TEXT */
            {
              /* write_glyphs writes at cursor position, so we need to
                 temporarily move cursor coordinates to the beginning of
                 the highlight region.  */

              /* Save current cursor co-ordinates */
              save_x = curX;
              save_y = curY;

              pos_x = row->used[LEFT_MARGIN_AREA] + start_hpos
                + WINDOW_LEFT_EDGE_X (w);
              pos_y = row->y + WINDOW_TOP_EDGE_Y (w);
        
              cursor_to (pos_x, pos_y);
              write_glyphs (row->glyphs[TEXT_AREA] + start_hpos, nglyphs);
              cursor_to (save_x, save_y);
            }
        }




reply via email to

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