/* These two kinds of events get special handling
and don't actually appear to the command loop.
We return nil for them. */
- if (event->kind == SELECTION_REQUEST_EVENT
- || event->kind == SELECTION_CLEAR_EVENT)
+ switch (event->kind)
+ {
+ case SELECTION_REQUEST_EVENT:
+ case SELECTION_CLEAR_EVENT:
{
#ifdef HAVE_X11
/* Remove it from the buffer before processing it,
emacs_abort ();
#endif
}
+ break;
#if defined (HAVE_NS)
- else if (event->kind == NS_TEXT_EVENT)
+ case NS_TEXT_EVENT:
{
if (event->ie.code == KEY_NS_PUT_WORKING_TEXT)
obj = list1 (intern ("ns-put-working-text"));
if (used_mouse_menu)
*used_mouse_menu = true;
}
+ break;
#endif
#if defined (HAVE_X11) || defined (HAVE_NTGUI) \
|| defined (HAVE_NS)
- else if (event->kind == DELETE_WINDOW_EVENT)
+ case DELETE_WINDOW_EVENT:
{
/* Make an event (delete-frame (FRAME)). */
obj = list2 (Qdelete_frame, list1 (event->ie.frame_or_window));
kbd_fetch_ptr = event + 1;
}
+ break;
#endif
#ifdef HAVE_NTGUI
- else if (event->kind == END_SESSION_EVENT)
+ case END_SESSION_EVENT:
{
/* Make an event (end-session). */
obj = list1 (Qend_session);
kbd_fetch_ptr = event + 1;
}
+ break;
#endif
#if defined (HAVE_X11) || defined (HAVE_NTGUI) \
|| defined (HAVE_NS)
- else if (event->kind == ICONIFY_EVENT)
+ case ICONIFY_EVENT:
{
/* Make an event (iconify-frame (FRAME)). */
obj = list2 (Qiconify_frame, list1 (event->ie.frame_or_window));
kbd_fetch_ptr = event + 1;
}
- else if (event->kind == DEICONIFY_EVENT)
+ break;
+ case DEICONIFY_EVENT:
{
/* Make an event (make-frame-visible (FRAME)). */
obj = list2 (Qmake_frame_visible, list1 (event->ie.frame_or_window));
kbd_fetch_ptr = event + 1;
}
+ break;
#endif
- else if (event->kind == BUFFER_SWITCH_EVENT)
+ case BUFFER_SWITCH_EVENT:
{
/* The value doesn't matter here; only the type is tested. */
XSETBUFFER (obj, current_buffer);
kbd_fetch_ptr = event + 1;
}
+ break;
#if defined (USE_X_TOOLKIT) || defined (HAVE_NTGUI) \
|| defined (HAVE_NS) || defined (USE_GTK)
- else if (event->kind == MENU_BAR_ACTIVATE_EVENT)
+ case MENU_BAR_ACTIVATE_EVENT:
{
kbd_fetch_ptr = event + 1;
input_pending = readable_events (0);
if (FRAME_LIVE_P (XFRAME (event->ie.frame_or_window)))
x_activate_menubar (XFRAME (event->ie.frame_or_window));
}
+ break;
#endif
#ifdef HAVE_NTGUI
- else if (event->kind == LANGUAGE_CHANGE_EVENT)
+ case LANGUAGE_CHANGE_EVENT:
{
/* Make an event (language-change FRAME CODEPAGE LANGUAGE-ID). */
obj = list4 (Qlanguage_change,
make_number (event->ie.modifiers));
kbd_fetch_ptr = event + 1;
}
+ break;
#endif
#ifdef USE_FILE_NOTIFY
- else if (event->kind == FILE_NOTIFY_EVENT)
+ case FILE_NOTIFY_EVENT:
{
#ifdef HAVE_W32NOTIFY
/* Make an event (file-notify (DESCRIPTOR ACTION FILE) CALLBACK). */
#endif
kbd_fetch_ptr = event + 1;
}
+ break;
#endif /* USE_FILE_NOTIFY */
- else if (event->kind == SAVE_SESSION_EVENT)
+ case SAVE_SESSION_EVENT:
{
obj = list2 (Qsave_session, event->ie.arg);
kbd_fetch_ptr = event + 1;
}
+ break;
/* Just discard these, by returning nil.
With MULTI_KBOARD, these events are used as placeholders
when we need to randomly delete events from the queue.
even without MULTI_KBOARD.) */
/* On Windows NT/9X, NO_EVENT is used to delete extraneous
mouse events during a popup-menu call. */
- else if (event->kind == NO_EVENT)
+ case NO_EVENT:
kbd_fetch_ptr = event + 1;
- else if (event->kind == HELP_EVENT)
+ break;
+ case HELP_EVENT:
{
Lisp_Object object, position, help, frame, window;
obj = Fcons (Qhelp_echo,
list5 (frame, help, window, object, position));
}
- else if (event->kind == FOCUS_IN_EVENT)
+ break;
+ case FOCUS_IN_EVENT:
{
/* Notification of a FocusIn event. The frame receiving the
focus is in event->frame_or_window. Generate a
internal_last_event_frame = frame;
kbd_fetch_ptr = event + 1;
}
- else if (event->kind == FOCUS_OUT_EVENT)
+ break;
+ case FOCUS_OUT_EVENT:
{
#ifdef HAVE_WINDOW_SYSTEM
kbd_fetch_ptr = event + 1;
}
+ break;
#ifdef HAVE_DBUS
- else if (event->kind == DBUS_EVENT)
+ case DBUS_EVENT:
{
obj = make_lispy_event (&event->ie);
kbd_fetch_ptr = event + 1;
}
+ break;
#endif
#if defined (HAVE_X11) || defined (HAVE_NTGUI) || defined (HAVE_NS)
- else if (event->kind == MOVE_FRAME_EVENT)
+ case MOVE_FRAME_EVENT:
{
/* Make an event (move-frame (FRAME)). */
obj = list2 (Qmove_frame, list1 (event->ie.frame_or_window));
kbd_fetch_ptr = event + 1;
}
+ break;
#endif
#ifdef HAVE_XWIDGETS
- else if (event->kind == XWIDGET_EVENT)
+ case XWIDGET_EVENT:
{
obj = make_lispy_event (&event->ie);
kbd_fetch_ptr = event + 1;
}
+ break;
#endif
- else if (event->kind == CONFIG_CHANGED_EVENT)
+ case CONFIG_CHANGED_EVENT:
{
obj = make_lispy_event (&event->ie);
kbd_fetch_ptr = event + 1;
}
- else if (event->kind == SELECT_WINDOW_EVENT)
+ break;
+ case SELECT_WINDOW_EVENT:
{
obj = list2 (Qselect_window, list1 (event->ie.frame_or_window));
kbd_fetch_ptr = event + 1;
}
- else
+ break;
+ default:
{
/* If this event is on a different frame, return a switch-frame this
time, and leave the event in the queue for next time. */
kbd_fetch_ptr = event + 1;
}
}
+ }
}
/* Try generating a mouse motion event. */
else if (!NILP (do_mouse_tracking) && some_mouse_moved ())