comparison src/event-stream.c @ 177:6075d714658b r20-3b15

Import from CVS: tag r20-3b15
author cvs
date Mon, 13 Aug 2007 09:51:16 +0200
parents 2d532a89d707
children 9ad43877534d
comparison
equal deleted inserted replaced
176:6866abce6aaf 177:6075d714658b
3019 return Qnil; 3019 return Qnil;
3020 3020
3021 return event_binding (event0, 1); 3021 return event_binding (event0, 1);
3022 } 3022 }
3023 3023
3024 #ifdef HAVE_X_WINDOWS 3024 #if defined(HAVE_X_WINDOWS) && defined(HAVE_MENUBARS)
3025 static void 3025 static void
3026 menu_move_up (void) 3026 menu_move_up (void)
3027 { 3027 {
3028 widget_value *current, *prev; 3028 widget_value *current, *prev;
3029 widget_value *entries; 3029 widget_value *entries;
3496 UNGCPRO; 3496 UNGCPRO;
3497 } 3497 }
3498 return Qnil; 3498 return Qnil;
3499 } 3499 }
3500 3500
3501 void 3501
3502 event_menu_accelerate () 3502 DEFUN ("accelerate-menu", Faccelerate_menu, 0, 0, "_", /*
3503 Make the menubar active. Menu items can be selected using menu accelerators
3504 or by actions defined in menu-accelerator-map.
3505 */
3506 ())
3503 { 3507 {
3504 struct console *con = XCONSOLE (Vselected_console); 3508 struct console *con = XCONSOLE (Vselected_console);
3505 struct frame *f = XFRAME (CONSOLE_SELECTED_FRAME (con)); 3509 struct frame *f = XFRAME (CONSOLE_SELECTED_FRAME (con));
3506 LWLIB_ID id = XPOPUP_DATA (f->menubar_data)->id; 3510 LWLIB_ID id = XPOPUP_DATA (f->menubar_data)->id;
3507 widget_value *val = lw_get_all_values (id); 3511 widget_value *val = lw_get_all_values (id);
3513 lw_display_menu (CurrentTime); 3517 lw_display_menu (CurrentTime);
3514 3518
3515 /* menu accelerator keys don't go into keyboard macros */ 3519 /* menu accelerator keys don't go into keyboard macros */
3516 if (!NILP (con->defining_kbd_macro) && NILP (Vexecuting_macro)) 3520 if (!NILP (con->defining_kbd_macro) && NILP (Vexecuting_macro))
3517 con->kbd_macro_ptr = con->kbd_macro_end; 3521 con->kbd_macro_ptr = con->kbd_macro_end;
3518 } 3522
3519 #endif /* HAVE_X_WINDOWS */ 3523 return Qnil;
3524 }
3525 #endif /* HAVE_X_WINDOWS && HAVE_MENUBARS */
3520 3526
3521 /* See if we can do function-key-map or key-translation-map translation 3527 /* See if we can do function-key-map or key-translation-map translation
3522 on the current events in the command builder. If so, do this, and 3528 on the current events in the command builder. If so, do this, and
3523 return the resulting binding, if any. */ 3529 return the resulting binding, if any. */
3524 3530
3644 3650
3645 if (XEVENT_TYPE (evee) == misc_user_event) 3651 if (XEVENT_TYPE (evee) == misc_user_event)
3646 return Qnil; 3652 return Qnil;
3647 3653
3648 /* if we're currently in a menu accelerator, check there for further events */ 3654 /* if we're currently in a menu accelerator, check there for further events */
3649 #ifdef HAVE_X_WINDOWS 3655 #if defined(HAVE_X_WINDOWS) && defined(HAVE_MENUBAR)
3650 if (lw_menu_active) 3656 if (lw_menu_active)
3651 { 3657 {
3652 result = command_builder_operate_menu_accelerator (builder); 3658 result = command_builder_operate_menu_accelerator (builder);
3653 return result; 3659 return result;
3654 } 3660 }
3658 if (EQ (Vmenu_accelerator_enabled, Qmenu_force)) 3664 if (EQ (Vmenu_accelerator_enabled, Qmenu_force))
3659 result = command_builder_find_menu_accelerator (builder); 3665 result = command_builder_find_menu_accelerator (builder);
3660 if (NILP (result)) 3666 if (NILP (result))
3661 #endif 3667 #endif
3662 result = command_builder_find_leaf_1 (builder); 3668 result = command_builder_find_leaf_1 (builder);
3663 #ifdef HAVE_X_WINDOWS 3669 #if defined(HAVE_X_WINDOWS) && defined(HAVE_MENUBAR)
3664 if (NILP (result) 3670 if (NILP (result)
3665 && EQ (Vmenu_accelerator_enabled, Qmenu_fallback)) 3671 && EQ (Vmenu_accelerator_enabled, Qmenu_fallback))
3666 result = command_builder_find_menu_accelerator (builder); 3672 result = command_builder_find_menu_accelerator (builder);
3667 } 3673 }
3668 #endif 3674 #endif
4856 DEFSUBR (Fdispatch_event); 4862 DEFSUBR (Fdispatch_event);
4857 DEFSUBR (Fread_key_sequence); 4863 DEFSUBR (Fread_key_sequence);
4858 DEFSUBR (Fthis_command_keys); 4864 DEFSUBR (Fthis_command_keys);
4859 DEFSUBR (Freset_this_command_lengths); 4865 DEFSUBR (Freset_this_command_lengths);
4860 DEFSUBR (Fopen_dribble_file); 4866 DEFSUBR (Fopen_dribble_file);
4867 DEFSUBR (Faccelerate_menu);
4861 4868
4862 defsymbol (&Qpre_command_hook, "pre-command-hook"); 4869 defsymbol (&Qpre_command_hook, "pre-command-hook");
4863 defsymbol (&Qpost_command_hook, "post-command-hook"); 4870 defsymbol (&Qpost_command_hook, "post-command-hook");
4864 defsymbol (&Qunread_command_events, "unread-command-events"); 4871 defsymbol (&Qunread_command_events, "unread-command-events");
4865 defsymbol (&Qunread_command_event, "unread-command-event"); 4872 defsymbol (&Qunread_command_event, "unread-command-event");