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: Andreas Schwab
Subject: [Emacs-diffs] Changes to emacs/src/xterm.c
Date: Thu, 17 Feb 2005 07:51:17 -0500

Index: emacs/src/xterm.c
diff -c emacs/src/xterm.c:1.860 emacs/src/xterm.c:1.861
*** emacs/src/xterm.c:1.860     Thu Feb  3 07:36:15 2005
--- emacs/src/xterm.c   Thu Feb 17 12:51:16 2005
***************
*** 5619,5626 ****
             f->output_data.x->saved_menu_event                         \
             = (XEvent *) xmalloc (sizeof (XEvent));                    \
           bcopy (&event, f->output_data.x->saved_menu_event, size);    \
!        inev.kind = MENU_BAR_ACTIVATE_EVENT;                           \
!        XSETFRAME (inev.frame_or_window, f);                           \
         }                                                              \
       while (0)
  
--- 5619,5626 ----
             f->output_data.x->saved_menu_event                         \
             = (XEvent *) xmalloc (sizeof (XEvent));                    \
           bcopy (&event, f->output_data.x->saved_menu_event, size);    \
!        inev.ie.kind = MENU_BAR_ACTIVATE_EVENT;                        \
!        XSETFRAME (inev.ie.frame_or_window, f);                        \
         }                                                              \
       while (0)
  
***************
*** 5727,5733 ****
       int *finish;
       struct input_event *hold_quit;
  {
!   struct input_event inev;
    int count = 0;
    int do_help = 0;
    int nbytes = 0;
--- 5727,5736 ----
       int *finish;
       struct input_event *hold_quit;
  {
!   union {
!     struct input_event ie;
!     struct selection_input_event sie;
!   } inev;
    int count = 0;
    int do_help = 0;
    int nbytes = 0;
***************
*** 5737,5745 ****
  
    *finish = X_EVENT_NORMAL;
  
!   EVENT_INIT (inev);
!   inev.kind = NO_EVENT;
!   inev.arg = Qnil;
  
    switch (event.type)
      {
--- 5740,5748 ----
  
    *finish = X_EVENT_NORMAL;
  
!   EVENT_INIT (inev.ie);
!   inev.ie.kind = NO_EVENT;
!   inev.ie.arg = Qnil;
  
    switch (event.type)
      {
***************
*** 5837,5844 ****
                  if (!f)
                  goto OTHER; /* May be a dialog that is to be removed  */
  
!               inev.kind = DELETE_WINDOW_EVENT;
!               XSETFRAME (inev.frame_or_window, f);
                goto done;
                }
  
--- 5840,5847 ----
                  if (!f)
                  goto OTHER; /* May be a dialog that is to be removed  */
  
!               inev.ie.kind = DELETE_WINDOW_EVENT;
!               XSETFRAME (inev.ie.frame_or_window, f);
                goto done;
                }
  
***************
*** 5901,5907 ****
          if (event.xclient.message_type
            == dpyinfo->Xatom_Scrollbar)
            {
!             x_scroll_bar_to_input_event (&event, &inev);
            *finish = X_EVENT_GOTO_OUT;
              goto done;
            }
--- 5904,5910 ----
          if (event.xclient.message_type
            == dpyinfo->Xatom_Scrollbar)
            {
!             x_scroll_bar_to_input_event (&event, &inev.ie);
            *finish = X_EVENT_GOTO_OUT;
              goto done;
            }
***************
*** 5912,5918 ****
        if (!f)
          goto OTHER;
  
!       if (x_handle_dnd_message (f, &event.xclient, dpyinfo, &inev))
          *finish = X_EVENT_DROP;
        }
        break;
--- 5915,5921 ----
        if (!f)
          goto OTHER;
  
!       if (x_handle_dnd_message (f, &event.xclient, dpyinfo, &inev.ie))
          *finish = X_EVENT_DROP;
        }
        break;
***************
*** 5933,5943 ****
        {
          XSelectionClearEvent *eventp = (XSelectionClearEvent *) &event;
  
!         inev.kind = SELECTION_CLEAR_EVENT;
!         SELECTION_EVENT_DISPLAY (&inev) = eventp->display;
!         SELECTION_EVENT_SELECTION (&inev) = eventp->selection;
!         SELECTION_EVENT_TIME (&inev) = eventp->time;
!         inev.frame_or_window = Qnil;
        }
        break;
  
--- 5936,5946 ----
        {
          XSelectionClearEvent *eventp = (XSelectionClearEvent *) &event;
  
!         inev.ie.kind = SELECTION_CLEAR_EVENT;
!         SELECTION_EVENT_DISPLAY (&inev.sie) = eventp->display;
!         SELECTION_EVENT_SELECTION (&inev.sie) = eventp->selection;
!         SELECTION_EVENT_TIME (&inev.sie) = eventp->time;
!         inev.ie.frame_or_window = Qnil;
        }
        break;
  
***************
*** 5950,5963 ****
            XSelectionRequestEvent *eventp
              = (XSelectionRequestEvent *) &event;
  
!           inev.kind = SELECTION_REQUEST_EVENT;
!           SELECTION_EVENT_DISPLAY (&inev) = eventp->display;
!           SELECTION_EVENT_REQUESTOR (&inev) = eventp->requestor;
!           SELECTION_EVENT_SELECTION (&inev) = eventp->selection;
!           SELECTION_EVENT_TARGET (&inev) = eventp->target;
!           SELECTION_EVENT_PROPERTY (&inev) = eventp->property;
!           SELECTION_EVENT_TIME (&inev) = eventp->time;
!           inev.frame_or_window = Qnil;
        }
        break;
  
--- 5953,5966 ----
            XSelectionRequestEvent *eventp
              = (XSelectionRequestEvent *) &event;
  
!           inev.ie.kind = SELECTION_REQUEST_EVENT;
!           SELECTION_EVENT_DISPLAY (&inev.sie) = eventp->display;
!           SELECTION_EVENT_REQUESTOR (&inev.sie) = eventp->requestor;
!           SELECTION_EVENT_SELECTION (&inev.sie) = eventp->selection;
!           SELECTION_EVENT_TARGET (&inev.sie) = eventp->target;
!           SELECTION_EVENT_PROPERTY (&inev.sie) = eventp->property;
!           SELECTION_EVENT_TIME (&inev.sie) = eventp->time;
!           inev.ie.frame_or_window = Qnil;
        }
        break;
  
***************
*** 6096,6103 ****
              {
                f->async_iconified = 1;
  
!               inev.kind = ICONIFY_EVENT;
!               XSETFRAME (inev.frame_or_window, f);
              }
          }
        goto OTHER;
--- 6099,6106 ----
              {
                f->async_iconified = 1;
  
!               inev.ie.kind = ICONIFY_EVENT;
!               XSETFRAME (inev.ie.frame_or_window, f);
              }
          }
        goto OTHER;
***************
*** 6129,6136 ****
  
            if (f->iconified)
              {
!               inev.kind = DEICONIFY_EVENT;
!               XSETFRAME (inev.frame_or_window, f);
              }
            else if (! NILP (Vframe_list)
                     && ! NILP (XCDR (Vframe_list)))
--- 6132,6139 ----
  
            if (f->iconified)
              {
!               inev.ie.kind = DEICONIFY_EVENT;
!               XSETFRAME (inev.ie.frame_or_window, f);
              }
            else if (! NILP (Vframe_list)
                     && ! NILP (XCDR (Vframe_list)))
***************
*** 6296,6313 ****
            orig_keysym = keysym;
  
          /* Common for all keysym input events.  */
!         XSETFRAME (inev.frame_or_window, f);
!         inev.modifiers
            = x_x_to_emacs_modifiers (FRAME_X_DISPLAY_INFO (f), modifiers);
!         inev.timestamp = event.xkey.time;
  
          /* First deal with keysyms which have defined
             translations to characters.  */
          if (keysym >= 32 && keysym < 128)
            /* Avoid explicitly decoding each ASCII character.  */
            {
!             inev.kind = ASCII_KEYSTROKE_EVENT;
!             inev.code = keysym;
              goto done_keysym;
            }
  
--- 6299,6316 ----
            orig_keysym = keysym;
  
          /* Common for all keysym input events.  */
!         XSETFRAME (inev.ie.frame_or_window, f);
!         inev.ie.modifiers
            = x_x_to_emacs_modifiers (FRAME_X_DISPLAY_INFO (f), modifiers);
!         inev.ie.timestamp = event.xkey.time;
  
          /* First deal with keysyms which have defined
             translations to characters.  */
          if (keysym >= 32 && keysym < 128)
            /* Avoid explicitly decoding each ASCII character.  */
            {
!             inev.ie.kind = ASCII_KEYSTROKE_EVENT;
!             inev.ie.code = keysym;
              goto done_keysym;
            }
  
***************
*** 6317,6326 ****
                                         Vx_keysym_table,
                                         Qnil))))
            {
!             inev.kind = (SINGLE_BYTE_CHAR_P (XFASTINT (c))
!                           ? ASCII_KEYSTROKE_EVENT
!                           : MULTIBYTE_CHAR_KEYSTROKE_EVENT);
!             inev.code = XFASTINT (c);
              goto done_keysym;
            }
  
--- 6320,6329 ----
                                         Vx_keysym_table,
                                         Qnil))))
            {
!             inev.ie.kind = (SINGLE_BYTE_CHAR_P (XFASTINT (c))
!                             ? ASCII_KEYSTROKE_EVENT
!                             : MULTIBYTE_CHAR_KEYSTROKE_EVENT);
!             inev.ie.code = XFASTINT (c);
              goto done_keysym;
            }
  
***************
*** 6410,6417 ****
              STORE_KEYSYM_FOR_DEBUG (keysym);
              /* make_lispy_event will convert this to a symbolic
                 key.  */
!             inev.kind = NON_ASCII_KEYSTROKE_EVENT;
!             inev.code = keysym;
              goto done_keysym;
            }
  
--- 6413,6420 ----
              STORE_KEYSYM_FOR_DEBUG (keysym);
              /* make_lispy_event will convert this to a symbolic
                 key.  */
!             inev.ie.kind = NON_ASCII_KEYSTROKE_EVENT;
!             inev.ie.code = keysym;
              goto done_keysym;
            }
  
***************
*** 6462,6479 ****
                else
                  c = STRING_CHAR_AND_LENGTH (copy_bufptr + i,
                                              nbytes - i, len);
!               inev.kind = (SINGLE_BYTE_CHAR_P (c)
                              ? ASCII_KEYSTROKE_EVENT
                              : MULTIBYTE_CHAR_KEYSTROKE_EVENT);
!               inev.code = c;
!               kbd_buffer_store_event_hold (&inev, hold_quit);
              }
  
            /* Previous code updated count by nchars rather than nbytes,
               but that seems bogus to me.  ++kfs  */
            count += nbytes;
  
!           inev.kind = NO_EVENT;  /* Already stored above.  */
  
            if (keysym == NoSymbol)
              break;
--- 6465,6482 ----
                else
                  c = STRING_CHAR_AND_LENGTH (copy_bufptr + i,
                                              nbytes - i, len);
!               inev.ie.kind = (SINGLE_BYTE_CHAR_P (c)
                              ? ASCII_KEYSTROKE_EVENT
                              : MULTIBYTE_CHAR_KEYSTROKE_EVENT);
!               inev.ie.code = c;
!               kbd_buffer_store_event_hold (&inev.ie, hold_quit);
              }
  
            /* Previous code updated count by nchars rather than nbytes,
               but that seems bogus to me.  ++kfs  */
            count += nbytes;
  
!           inev.ie.kind = NO_EVENT;  /* Already stored above.  */
  
            if (keysym == NoSymbol)
              break;
***************
*** 6500,6506 ****
  #endif
  
      case EnterNotify:
!       x_detect_focus_change (dpyinfo, &event, &inev);
  
        f = x_any_window_to_frame (dpyinfo, event.xcrossing.window);
  
--- 6503,6509 ----
  #endif
  
      case EnterNotify:
!       x_detect_focus_change (dpyinfo, &event, &inev.ie);
  
        f = x_any_window_to_frame (dpyinfo, event.xcrossing.window);
  
***************
*** 6530,6540 ****
        goto OTHER;
  
      case FocusIn:
!       x_detect_focus_change (dpyinfo, &event, &inev);
        goto OTHER;
  
      case LeaveNotify:
!       x_detect_focus_change (dpyinfo, &event, &inev);
  
        f = x_top_window_to_frame (dpyinfo, event.xcrossing.window);
        if (f)
--- 6533,6543 ----
        goto OTHER;
  
      case FocusIn:
!       x_detect_focus_change (dpyinfo, &event, &inev.ie);
        goto OTHER;
  
      case LeaveNotify:
!       x_detect_focus_change (dpyinfo, &event, &inev.ie);
  
        f = x_top_window_to_frame (dpyinfo, event.xcrossing.window);
        if (f)
***************
*** 6557,6563 ****
        goto OTHER;
  
      case FocusOut:
!       x_detect_focus_change (dpyinfo, &event, &inev);
        goto OTHER;
  
      case MotionNotify:
--- 6560,6566 ----
        goto OTHER;
  
      case FocusOut:
!       x_detect_focus_change (dpyinfo, &event, &inev.ie);
        goto OTHER;
  
      case MotionNotify:
***************
*** 6597,6604 ****
                      && !EQ (window, last_window)
                      && !EQ (window, selected_window))
                    {
!                     inev.kind = SELECT_WINDOW_EVENT;
!                     inev.frame_or_window = window;
                    }
  
                  last_window=window;
--- 6600,6607 ----
                      && !EQ (window, last_window)
                      && !EQ (window, selected_window))
                    {
!                     inev.ie.kind = SELECT_WINDOW_EVENT;
!                     inev.ie.frame_or_window = window;
                    }
  
                  last_window=window;
***************
*** 6757,6769 ****
                              && (int)(event.xbutton.time - 
ignore_next_mouse_click_timeout) > 0)
                            {
                              ignore_next_mouse_click_timeout = 0;
!                             construct_mouse_click (&inev, &event, f);
                            }
                          if (event.type == ButtonRelease)
                            ignore_next_mouse_click_timeout = 0;
                        }
                      else
!                       construct_mouse_click (&inev, &event, f);
                    }
                  }
            }
--- 6760,6772 ----
                              && (int)(event.xbutton.time - 
ignore_next_mouse_click_timeout) > 0)
                            {
                              ignore_next_mouse_click_timeout = 0;
!                             construct_mouse_click (&inev.ie, &event, f);
                            }
                          if (event.type == ButtonRelease)
                            ignore_next_mouse_click_timeout = 0;
                        }
                      else
!                       construct_mouse_click (&inev.ie, &event, f);
                    }
                  }
            }
***************
*** 6778,6789 ****
                 scroll bars.  */
              if (bar && event.xbutton.state & ControlMask)
                {
!                 x_scroll_bar_handle_click (bar, &event, &inev);
                  *finish = X_EVENT_DROP;
                }
  #else /* not USE_TOOLKIT_SCROLL_BARS */
              if (bar)
!               x_scroll_bar_handle_click (bar, &event, &inev);
  #endif /* not USE_TOOLKIT_SCROLL_BARS */
            }
  
--- 6781,6792 ----
                 scroll bars.  */
              if (bar && event.xbutton.state & ControlMask)
                {
!                 x_scroll_bar_handle_click (bar, &event, &inev.ie);
                  *finish = X_EVENT_DROP;
                }
  #else /* not USE_TOOLKIT_SCROLL_BARS */
              if (bar)
!               x_scroll_bar_handle_click (bar, &event, &inev.ie);
  #endif /* not USE_TOOLKIT_SCROLL_BARS */
            }
  
***************
*** 6891,6899 ****
      }
  
   done:
!   if (inev.kind != NO_EVENT)
      {
!       kbd_buffer_store_event_hold (&inev, hold_quit);
        count++;
      }
  
--- 6894,6902 ----
      }
  
   done:
!   if (inev.ie.kind != NO_EVENT)
      {
!       kbd_buffer_store_event_hold (&inev.ie, hold_quit);
        count++;
      }
  




reply via email to

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