comparison src/keyboard.c @ 5684:6479e0eabb27

* keyboard.c (make_lispy_event): Add USE_X_TOOLKIT conditional and test FRAME_EXTERNAL_MENU_BAR. (map_event_to_object) [USE_X_TOOLKIT]: Declare and use it.
author Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
date Thu, 27 Jan 1994 11:01:59 +0000
parents bb8bfab97970
children 8fae1a51e9c5
comparison
equal deleted inserted replaced
5683:b9bafc8d0283 5684:6479e0eabb27
2384 2384
2385 /* The number of clicks in this multiple-click. */ 2385 /* The number of clicks in this multiple-click. */
2386 2386
2387 int double_click_count; 2387 int double_click_count;
2388 2388
2389 #ifdef USE_X_TOOLKIT
2390 extern Lisp_Object map_event_to_object ();
2391 #endif /* USE_X_TOOLKIT */
2392
2389 /* Given a struct input_event, build the lisp event which represents 2393 /* Given a struct input_event, build the lisp event which represents
2390 it. If EVENT is 0, build a mouse movement event from the mouse 2394 it. If EVENT is 0, build a mouse movement event from the mouse
2391 movement buffer, which should have a movement event in it. 2395 movement buffer, which should have a movement event in it.
2392 2396
2393 Note that events must be passed to this function in the order they 2397 Note that events must be passed to this function in the order they
2482 Lisp_Object window 2486 Lisp_Object window
2483 = window_from_coordinates (f, XINT (event->x), XINT (event->y), 2487 = window_from_coordinates (f, XINT (event->x), XINT (event->y),
2484 &part); 2488 &part);
2485 Lisp_Object posn; 2489 Lisp_Object posn;
2486 2490
2491 #ifdef USE_X_TOOLKIT
2492 if (FRAME_EXTERNAL_MENU_BAR (f) && XINT (event->y) == -1)
2493 {
2494 /* The click happened in the menubar.
2495 Look for the menu item selected. */
2496 Lisp_Object items = map_event_to_object(event, f);
2497 XFASTINT (event->y) = 1;
2498 #else /* not USE_X_TOOLKIT */
2487 if (XINT (event->y) < FRAME_MENU_BAR_LINES (f)) 2499 if (XINT (event->y) < FRAME_MENU_BAR_LINES (f))
2488 { 2500 {
2489 int hpos; 2501 int hpos;
2490 Lisp_Object items; 2502 Lisp_Object items;
2491 items = FRAME_MENU_BAR_ITEMS (f); 2503 items = FRAME_MENU_BAR_ITEMS (f);
2496 string = Fcar (Fcdr (Fcar (items))); 2508 string = Fcar (Fcdr (Fcar (items)));
2497 if (XINT (event->x) >= XINT (pos) 2509 if (XINT (event->x) >= XINT (pos)
2498 && XINT (event->x) < XINT (pos) + XSTRING (string)->size) 2510 && XINT (event->x) < XINT (pos) + XSTRING (string)->size)
2499 break; 2511 break;
2500 } 2512 }
2513 #endif /* not USE_X_TOOLKIT */
2501 position 2514 position
2502 = Fcons (event->frame_or_window, 2515 = Fcons (event->frame_or_window,
2503 Fcons (Qmenu_bar, 2516 Fcons (Qmenu_bar,
2504 Fcons (Fcons (event->x, event->y), 2517 Fcons (Fcons (event->x, event->y),
2505 Fcons (make_number (event->timestamp), 2518 Fcons (make_number (event->timestamp),