emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/src/xterm.c


From: Gerd Moellmann
Subject: [Emacs-diffs] Changes to emacs/src/xterm.c
Date: Fri, 12 Apr 2002 05:33:53 -0400

Index: emacs/src/xterm.c
diff -c emacs/src/xterm.c:1.720 emacs/src/xterm.c:1.721
*** emacs/src/xterm.c:1.720     Wed Apr  3 03:39:50 2002
--- emacs/src/xterm.c   Fri Apr 12 05:33:52 2002
***************
*** 429,435 ****
  static void set_output_cursor P_ ((struct cursor_pos *));
  static struct glyph *x_y_to_hpos_vpos P_ ((struct window *, int, int,
                                           int *, int *, int *, int));
! static void note_mode_line_highlight P_ ((struct window *, int, int));
  static void note_mouse_highlight P_ ((struct frame *, int, int));
  static void note_tool_bar_highlight P_ ((struct frame *f, int, int));
  static void x_handle_tool_bar_click P_ ((struct frame *, XButtonEvent *));
--- 429,436 ----
  static void set_output_cursor P_ ((struct cursor_pos *));
  static struct glyph *x_y_to_hpos_vpos P_ ((struct window *, int, int,
                                           int *, int *, int *, int));
! static void note_mode_line_or_margin_highlight P_ ((struct window *, int,
!                                                   int, int));
  static void note_mouse_highlight P_ ((struct frame *, int, int));
  static void note_tool_bar_highlight P_ ((struct frame *f, int, int));
  static void x_handle_tool_bar_click P_ ((struct frame *, XButtonEvent *));
***************
*** 851,857 ****
    Window window = FRAME_X_WINDOW (f);
    int x, y, wd, h, dy;
    int b1, b2;
!   unsigned char *bits;
    Pixmap pixmap;
    GC gc = f->output_data.x->normal_gc;
    struct face *face;
--- 852,858 ----
    Window window = FRAME_X_WINDOW (f);
    int x, y, wd, h, dy;
    int b1, b2;
!   unsigned char *bits = NULL;
    Pixmap pixmap;
    GC gc = f->output_data.x->normal_gc;
    struct face *face;
***************
*** 6791,6870 ****
  }
  
  
! /* Take proper action when mouse has moved to the mode or header line of
!    window W, x-position X.  MODE_LINE_P non-zero means mouse is on the
!    mode line.  X is relative to the start of the text display area of
!    W, so the width of fringes and scroll bars must be subtracted
!    to get a position relative to the start of the mode line.  */
! 
  static void
! note_mode_line_highlight (w, x, mode_line_p)
       struct window *w;
!      int x, mode_line_p;
  {
    struct frame *f = XFRAME (w->frame);
    struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
    Cursor cursor = dpyinfo->vertical_scroll_bar_cursor;
    struct glyph_row *row;
  
!   if (mode_line_p)
!     row = MATRIX_MODE_LINE_ROW (w->current_matrix);
!   else
!     row = MATRIX_HEADER_LINE_ROW (w->current_matrix);
! 
!   if (row->enabled_p)
!     {
!       struct glyph *glyph, *end;
!       Lisp_Object help, map;
!       int x0;
!       
!       /* Find the glyph under X.  */
!       glyph = row->glyphs[TEXT_AREA];
!       end = glyph + row->used[TEXT_AREA];
!       x0 = - (FRAME_LEFT_SCROLL_BAR_WIDTH (f) * CANON_X_UNIT (f)
!             + FRAME_X_LEFT_FRINGE_WIDTH (f));
!       
!       while (glyph < end
!            && x >= x0 + glyph->pixel_width)
!       {
!         x0 += glyph->pixel_width;
!         ++glyph;
!       }
! 
!       if (glyph < end
!         && STRINGP (glyph->object)
!         && XSTRING (glyph->object)->intervals
!         && glyph->charpos >= 0
!         && glyph->charpos < XSTRING (glyph->object)->size)
!       {
!         /* If we're on a string with `help-echo' text property,
!            arrange for the help to be displayed.  This is done by
!            setting the global variable help_echo to the help string.  */
!         help = Fget_text_property (make_number (glyph->charpos),
!                                    Qhelp_echo, glyph->object);
!         if (!NILP (help))
!           {
!             help_echo = help;
!             XSETWINDOW (help_echo_window, w);
!             help_echo_object = glyph->object;
!             help_echo_pos = glyph->charpos;
!           }
! 
!         /* Change the mouse pointer according to what is under X/Y.  */
!         map = Fget_text_property (make_number (glyph->charpos),
!                                   Qlocal_map, glyph->object);
!         if (KEYMAPP (map))
!           cursor = f->output_data.x->nontext_cursor;
!         else
!           {
!             map = Fget_text_property (make_number (glyph->charpos),
!                                       Qkeymap, glyph->object);
!             if (KEYMAPP (map))
!               cursor = f->output_data.x->nontext_cursor;
!           }
!       }
      }
! 
    XDefineCursor (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), cursor);
  }
  
--- 6792,6846 ----
  }
  
  
! /* Take proper action when mouse has moved to the mode or header line
!    or marginal area of window W, x-position X and y-position Y.  Area
!    is 1, 3, 6 or 7 for the mode line, header line, left and right
!    marginal area respectively.  X is relative to the start of the text
!    display area of W, so the width of bitmap areas and scroll bars
!    must be subtracted to get a position relative to the start of the
!    mode line.  */
!  
  static void
! note_mode_line_or_margin_highlight (w, x, y, portion)
       struct window *w;
!      int x, y, portion;
  {
    struct frame *f = XFRAME (w->frame);
    struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
    Cursor cursor = dpyinfo->vertical_scroll_bar_cursor;
    struct glyph_row *row;
+   int i, area, charpos;
+   Lisp_Object string, help, map, pos;
  
!   if (portion == 1 || portion == 3)
!     string = mode_line_string (w, x, y, portion == 1, &charpos);
!    else
!      string = marginal_area_string (w, x, y, portion, &charpos);
! 
!   if (STRINGP (string))
!     {
!       pos = make_number (charpos);
!       
!       /* If we're on a string with `help-echo' text property, arrange
!        for the help to be displayed.  This is done by setting the
!        global variable help_echo to the help string.  */
!       help = Fget_text_property (pos, Qhelp_echo, string);
!       if (!NILP (help))
!       {
!         help_echo = help;
!         XSETWINDOW (help_echo_window, w);
!         help_echo_object = string;
!         help_echo_pos = charpos;
!       }
! 
!      /* Change the mouse pointer according to what is under X/Y.  */
!       map = Fget_text_property (pos, Qlocal_map, string);
!       if (!KEYMAPP (map))
!       map = Fget_text_property (pos, Qkeymap, string);
!       if (KEYMAPP (map))
!       cursor = f->output_data.x->nontext_cursor;
      }
!   
    XDefineCursor (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), cursor);
  }
  
***************
*** 6932,6941 ****
        return;
      }
  
!   /* Mouse is on the mode or header line?  */
!   if (portion == 1 || portion == 3)
      {
!       note_mode_line_highlight (w, x, portion == 1);
        return;
      }
    
--- 6908,6917 ----
        return;
      }
  
!   /* Mouse is on the mode, header line or margin?  */
!   if (portion == 1 || portion == 3 || portion == 6 || portion == 7)
      {
!       note_mode_line_or_margin_highlight (w, x, y, portion);
        return;
      }
    



reply via email to

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