comparison src/event-Xt.c @ 22:8fc7fe29b841 r19-15b94

Import from CVS: tag r19-15b94
author cvs
date Mon, 13 Aug 2007 08:50:29 +0200
parents 859a2309aef8
children 4103f0995bd7
comparison
equal deleted inserted replaced
21:b88636d63495 22:8fc7fe29b841
590 590
591 /************************************************************************/ 591 /************************************************************************/
592 /* X to Emacs event conversion */ 592 /* X to Emacs event conversion */
593 /************************************************************************/ 593 /************************************************************************/
594 594
595 #if (defined(sun) || defined(__sun)) && defined(__GNUC__)
596 # define SUNOS_GCC_L0_BUG
597 #endif
598
599 #ifdef SUNOS_GCC_L0_BUG
600 static void
601 x_to_emacs_keysym_sunos_bug (Lisp_Object *return_value_sunos_bug, /* #### */
602 XEvent *event, int simple_p)
603 #else /* !SUNOS_GCC_L0_BUG */
604 static Lisp_Object 595 static Lisp_Object
605 x_to_emacs_keysym (XKeyPressedEvent *event, int simple_p) 596 x_to_emacs_keysym (XKeyPressedEvent *event, int simple_p)
606 #endif /* !SUNOS_GCC_L0_BUG */
607 /* simple_p means don't try too hard (ASCII only) */ 597 /* simple_p means don't try too hard (ASCII only) */
608 { 598 {
609 char *name; 599 char *name;
610 KeySym keysym = 0; 600 KeySym keysym = 0;
611 /* Apparently it's necessary to specify a dummy here (rather than 601 /* Apparently it's necessary to specify a dummy here (rather than
612 passing in 0) to avoid crashes on German IRIX */ 602 passing in 0) to avoid crashes on German IRIX */
613 char dummy[256]; 603 char dummy[256];
614
615 #ifdef SUNOS_GCC_L0_BUG
616 # define return(lose) \
617 do {*return_value_sunos_bug = (lose); goto return_it; } while (0)
618 #endif
619 604
620 /* ### FIX this by replacing with calls to XmbLookupString. 605 /* ### FIX this by replacing with calls to XmbLookupString.
621 XLookupString should never be called. --mrb */ 606 XLookupString should never be called. --mrb */
622 XLookupString (event, dummy, 200, &keysym, 0); 607 XLookupString (event, dummy, 200, &keysym, 0);
623 608
680 *s2 = 0; 665 *s2 = 0;
681 return KEYSYM (buf); 666 return KEYSYM (buf);
682 } 667 }
683 return KEYSYM (name); 668 return KEYSYM (name);
684 } 669 }
685 #ifdef SUNOS_GCC_L0_BUG 670 }
686 # undef return
687 return_it:
688 return;
689 #endif
690 }
691
692 #ifdef SUNOS_GCC_L0_BUG
693 /* #### */
694 static Lisp_Object
695 x_to_emacs_keysym (XEvent *event, int simple_p)
696 {
697 Lisp_Object return_value_sunos_bug;
698 x_to_emacs_keysym_sunos_bug (&return_value_sunos_bug, event, simple_p);
699 return (return_value_sunos_bug);
700 }
701 #endif
702 671
703 static void 672 static void
704 set_last_server_timestamp (struct device *d, XEvent *x_event) 673 set_last_server_timestamp (struct device *d, XEvent *x_event)
705 { 674 {
706 Time t; 675 Time t;