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

Diff of /emacs/src/keyboard.c

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

revision 1.749 by jasonr, Sun Jun 1 21:48:53 2003 UTC revision 1.750 by jasonr, Wed Jun 4 22:05:52 2003 UTC
# Line 547  Lisp_Object Qhelp_echo; Line 547  Lisp_Object Qhelp_echo;
547  /* Symbols to denote kinds of events.  */  /* Symbols to denote kinds of events.  */
548  Lisp_Object Qfunction_key;  Lisp_Object Qfunction_key;
549  Lisp_Object Qmouse_click;  Lisp_Object Qmouse_click;
 #if defined(MAC_OSX)  
 Lisp_Object Qmouse_wheel;  
 #endif  
550  #ifdef WINDOWSNT  #ifdef WINDOWSNT
551  Lisp_Object Qlanguage_change;  Lisp_Object Qlanguage_change;
552  #endif  #endif
# Line 4438  static Lisp_Object accent_key_syms; Line 4435  static Lisp_Object accent_key_syms;
4435  static Lisp_Object func_key_syms;  static Lisp_Object func_key_syms;
4436  static Lisp_Object mouse_syms;  static Lisp_Object mouse_syms;
4437  static Lisp_Object wheel_syms;  static Lisp_Object wheel_syms;
 #if defined(MAC_OSX)  
 static Lisp_Object mouse_wheel_syms;  
 #endif  
4438  static Lisp_Object drag_n_drop_syms;  static Lisp_Object drag_n_drop_syms;
4439    
4440  /* This is a list of keysym codes for special "accent" characters.  /* This is a list of keysym codes for special "accent" characters.
# Line 4899  static char *lispy_wheel_names[] = Line 4893  static char *lispy_wheel_names[] =
4893    "wheel-up", "wheel-down"    "wheel-up", "wheel-down"
4894  };  };
4895    
 #if defined(MAC_OSX)  
 /* mouse-wheel events are generated by the wheel on devices such as  
    the MS Intellimouse.  The wheel sits in between the left and right  
    mouse buttons, and is typically used to scroll or zoom the window  
    underneath the pointer.  mouse-wheel events specify the object on  
    which they operate, and a delta corresponding to the amount and  
    direction that the wheel is rotated.  Clicking the mouse-wheel  
    generates a mouse-2 event.  */  
 static char *lispy_mouse_wheel_names[] =  
 {  
   "mouse-wheel"  
 };  
   
 #endif /* MAC_OSX */  
   
4896  /* drag-n-drop events are generated when a set of selected files are  /* drag-n-drop events are generated when a set of selected files are
4897     dragged from another application and dropped onto an Emacs window.  */     dragged from another application and dropped onto an Emacs window.  */
4898  static char *lispy_drag_n_drop_names[] =  static char *lispy_drag_n_drop_names[] =
# Line 5707  make_lispy_event (event) Line 5686  make_lispy_event (event)
5686          }          }
5687        }        }
5688  #endif /* WINDOWSNT */  #endif /* WINDOWSNT */
 #if defined(MAC_OSX)  
     case MOUSE_WHEEL_EVENT:  
       {  
         enum window_part part;  
         FRAME_PTR f = XFRAME (event->frame_or_window);  
         Lisp_Object window;  
         Lisp_Object posn;  
         Lisp_Object head, position;  
         int row, column;  
   
         /* Ignore mouse events that were made on frame that  
            have been deleted.  */  
         if (! FRAME_LIVE_P (f))  
           return Qnil;  
         pixel_to_glyph_coords (f, XINT (event->x), XINT (event->y),  
                                &column, &row, NULL, 1);  
         window = window_from_coordinates (f, XINT (event->x),  
                                           XINT (event->y),  
                                           &part, 0, 0, 0);  
   
         if (!WINDOWP (window))  
           {  
             window = event->frame_or_window;  
             posn = Qnil;  
           }  
         else  
           {  
             int pixcolumn, pixrow;  
             column -= WINDOW_LEFT_EDGE_COL (XWINDOW (window));  
             row -= WINDOW_TOP_EDGE_LINE (XWINDOW (window));  
             glyph_to_pixel_coords (XWINDOW(window), column, row,  
                                    &pixcolumn, &pixrow);  
             XSETINT (event->x, pixcolumn);  
             XSETINT (event->y, pixrow);  
   
             if (part == ON_MODE_LINE)  
               posn = Qmode_line;  
             else if (part == ON_VERTICAL_BORDER)  
               posn = Qvertical_line;  
             else if (part == ON_HEADER_LINE)  
               posn = Qheader_line;  
             else  
               {  
                 Lisp_Object object;  
                 struct display_pos p;  
                 buffer_posn_from_coords (XWINDOW (window), &column, &row,  
                                          &object, &p);  
                 posn = make_number (CHARPOS (p.pos));  
               }  
           }  
   
         {  
           Lisp_Object head, position;  
   
           position  
             = Fcons (window,  
                      Fcons (posn,  
                             Fcons (Fcons (event->x, event->y),  
                                    Fcons (make_number (event->timestamp),  
                                           Qnil))));  
   
           head = modify_event_symbol (0, event->modifiers,  
                                       Qmouse_wheel, Qnil,  
                                       lispy_mouse_wheel_names,  
                                       &mouse_wheel_syms, 1);  
           return Fcons (head,  
                         Fcons (position,  
                                /* Insert 1 here so event-click-count works.  */  
                                Fcons (make_number (1),  
                                       Fcons (make_number (event->code),  
                                              Qnil))));  
         }  
       }  
 #endif /* MAC_OSX */  
5689    
5690      case DRAG_N_DROP_EVENT:      case DRAG_N_DROP_EVENT:
5691        {        {
# Line 10868  syms_of_keyboard () Line 10773  syms_of_keyboard ()
10773    staticpro (&Qfunction_key);    staticpro (&Qfunction_key);
10774    Qmouse_click = intern ("mouse-click");    Qmouse_click = intern ("mouse-click");
10775    staticpro (&Qmouse_click);    staticpro (&Qmouse_click);
 #if defined(MAC_OSX)  
   Qmouse_wheel = intern ("mouse-wheel");  
   staticpro (&Qmouse_wheel);  
 #endif  
10776  #ifdef WINDOWSNT  #ifdef WINDOWSNT
10777    Qlanguage_change = intern ("language-change");    Qlanguage_change = intern ("language-change");
10778    staticpro (&Qlanguage_change);    staticpro (&Qlanguage_change);
# Line 11022  syms_of_keyboard () Line 10923  syms_of_keyboard ()
10923    func_key_syms = Qnil;    func_key_syms = Qnil;
10924    staticpro (&func_key_syms);    staticpro (&func_key_syms);
10925    
 #if defined(MAC_OSX)  
   mouse_wheel_syms = Qnil;  
   staticpro (&mouse_wheel_syms);  
10926    drag_n_drop_syms = Qnil;    drag_n_drop_syms = Qnil;
10927    staticpro (&drag_n_drop_syms);    staticpro (&drag_n_drop_syms);
 #endif  
10928    
10929    unread_switch_frame = Qnil;    unread_switch_frame = Qnil;
10930    staticpro (&unread_switch_frame);    staticpro (&unread_switch_frame);

Legend:
Removed from v.1.749  
changed lines
  Added in v.1.750

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