comparison src/event-xlike-inc.c @ 5118:e0db3c197671 ben-lisp-object

merge up to latest default branch, doesn't compile yet
author Ben Wing <ben@xemacs.org>
date Sat, 26 Dec 2009 21:18:49 -0600
parents 63c25d1cbecf
children b3ce27ca7647
comparison
equal deleted inserted replaced
5117:3742ea8250b5 5118:e0db3c197671
24 24
25 /* For some code it's reasonable to have only one copy and conditionalize 25 /* For some code it's reasonable to have only one copy and conditionalize
26 at run-time. For other code it isn't. #### Perhaps all code should be 26 at run-time. For other code it isn't. #### Perhaps all code should be
27 included here, not in event-xlike.c. However, event-xlike.c is always 27 included here, not in event-xlike.c. However, event-xlike.c is always
28 X-specific, whereas the following code isn't, in the GTK case. */ 28 X-specific, whereas the following code isn't, in the GTK case. */
29
30 EXFUN (Funicode_to_char, 2); /* In unicode.c. */
31 29
32 static int 30 static int
33 #ifdef THIS_IS_GTK 31 #ifdef THIS_IS_GTK
34 emacs_gtk_event_pending_p (int how_many) 32 emacs_gtk_event_pending_p (int how_many)
35 #else 33 #else
352 0x215A, /* #x0AB7 VULGAR FRACTION FIVE SIXTHS Publish */ 350 0x215A, /* #x0AB7 VULGAR FRACTION FIVE SIXTHS Publish */
353 0x2105, /* #x0AB8 CARE OF Publish */ 351 0x2105, /* #x0AB8 CARE OF Publish */
354 0x0, /* #x0AB9 */ 352 0x0, /* #x0AB9 */
355 0x0, /* #x0ABA */ 353 0x0, /* #x0ABA */
356 0x2012, /* #x0ABB FIGURE DASH Publish */ 354 0x2012, /* #x0ABB FIGURE DASH Publish */
357 0x0, /* #x0ABC LEFT ANGLE BRACKET Publish */ 355 0x3008, /* #x0ABC LEFT ANGLE BRACKET Publish */
358 0x0, /* #x0ABD DECIMAL POINT Publish */ 356 0x002E, /* #x0ABD DECIMAL POINT Publish */
359 0x0, /* #x0ABE RIGHT ANGLE BRACKET Publish */ 357 0x3009, /* #x0ABE RIGHT ANGLE BRACKET Publish */
360 0x0, /* #x0ABF MARKER Publish */ 358 0x0, /* #x0ABF MARKER Publish */
361 0x0, /* #x0AC0 */ 359 0x0, /* #x0AC0 */
362 0x0, /* #x0AC1 */ 360 0x0, /* #x0AC1 */
363 0x0, /* #x0AC2 */ 361 0x0, /* #x0AC2 */
364 0x215B, /* #x0AC3 VULGAR FRACTION ONE EIGHTH Publish */ 362 0x215B, /* #x0AC3 VULGAR FRACTION ONE EIGHTH Publish */
459 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, /* 0x0BB0--0x0BBB */ 457 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, /* 0x0BB0--0x0BBB */
460 0x0, 0x0, 0x0, 0x0, 458 0x0, 0x0, 0x0, 0x0,
461 0x22A3, /* #x0BFC RIGHT TACK APL */ 459 0x22A3, /* #x0BFC RIGHT TACK APL */
462 }; 460 };
463 461
462 static UINT_16_BIT const CYRILLIC[] =
463 {
464 0x0452, /* #x06A1 CYRILLIC SMALL LETTER DJE */
465 #define FIRST_KNOWN_CYRILLIC 0x6A1
466 0x0453, /* #x06A2 CYRILLIC SMALL LETTER GJE */
467 0x0451, /* #x06A3 CYRILLIC SMALL LETTER IO */
468 0x0454, /* #x06A4 CYRILLIC SMALL LETTER UKRAINIAN IE */
469 0x0455, /* #x06A5 CYRILLIC SMALL LETTER DZE */
470 0x0456, /* #x06A6 CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I */
471 0x0457, /* #x06A7 CYRILLIC SMALL LETTER YI */
472 0x0458, /* #x06A8 CYRILLIC SMALL LETTER JE */
473 0x0459, /* #x06A9 CYRILLIC SMALL LETTER LJE */
474 0x045A, /* #x06AA CYRILLIC SMALL LETTER NJE */
475 0x045B, /* #x06AB CYRILLIC SMALL LETTER TSHE */
476 0x045C, /* #x06AC CYRILLIC SMALL LETTER KJE */
477 0x0491, /* #x06AD CYRILLIC SMALL LETTER GHE WITH UPTURN */
478 0x045E, /* #x06AE CYRILLIC SMALL LETTER SHORT U */
479 0x045F, /* #x06AF CYRILLIC SMALL LETTER DZHE */
480 0x2116, /* #x06B0 NUMERO SIGN */
481 0x0402, /* #x06B1 CYRILLIC CAPITAL LETTER DJE */
482 0x0403, /* #x06B2 CYRILLIC CAPITAL LETTER GJE */
483 0x0401, /* #x06B3 CYRILLIC CAPITAL LETTER IO */
484 0x0404, /* #x06B4 CYRILLIC CAPITAL LETTER UKRAINIAN IE */
485 0x0405, /* #x06B5 CYRILLIC CAPITAL LETTER DZE */
486 0x0406, /* #x06B6 CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I */
487 0x0407, /* #x06B7 CYRILLIC CAPITAL LETTER YI */
488 0x0408, /* #x06B8 CYRILLIC CAPITAL LETTER JE */
489 0x0409, /* #x06B9 CYRILLIC CAPITAL LETTER LJE */
490 0x040A, /* #x06BA CYRILLIC CAPITAL LETTER NJE */
491 0x040B, /* #x06BB CYRILLIC CAPITAL LETTER TSHE */
492 0x040C, /* #x06BC CYRILLIC CAPITAL LETTER KJE */
493 0x0490, /* #x06BD CYRILLIC CAPITAL LETTER GHE WITH UPTURN */
494 0x040E, /* #x06BE CYRILLIC CAPITAL LETTER SHORT U */
495 0x040F, /* #x06BF CYRILLIC CAPITAL LETTER DZHE */
496 0x044E, /* #x06C0 CYRILLIC SMALL LETTER YU */
497 0x0430, /* #x06C1 CYRILLIC SMALL LETTER A */
498 0x0431, /* #x06C2 CYRILLIC SMALL LETTER BE */
499 0x0446, /* #x06C3 CYRILLIC SMALL LETTER TSE */
500 0x0434, /* #x06C4 CYRILLIC SMALL LETTER DE */
501 0x0435, /* #x06C5 CYRILLIC SMALL LETTER IE */
502 0x0444, /* #x06C6 CYRILLIC SMALL LETTER EF */
503 0x0433, /* #x06C7 CYRILLIC SMALL LETTER GHE */
504 0x0445, /* #x06C8 CYRILLIC SMALL LETTER HA */
505 0x0438, /* #x06C9 CYRILLIC SMALL LETTER I */
506 0x0439, /* #x06CA CYRILLIC SMALL LETTER SHORT I */
507 0x043A, /* #x06CB CYRILLIC SMALL LETTER KA */
508 0x043B, /* #x06CC CYRILLIC SMALL LETTER EL */
509 0x043C, /* #x06CD CYRILLIC SMALL LETTER EM */
510 0x043D, /* #x06CE CYRILLIC SMALL LETTER EN */
511 0x043E, /* #x06CF CYRILLIC SMALL LETTER O */
512 0x043F, /* #x06D0 CYRILLIC SMALL LETTER PE */
513 0x044F, /* #x06D1 CYRILLIC SMALL LETTER YA */
514 0x0440, /* #x06D2 CYRILLIC SMALL LETTER ER */
515 0x0441, /* #x06D3 CYRILLIC SMALL LETTER ES */
516 0x0442, /* #x06D4 CYRILLIC SMALL LETTER TE */
517 0x0443, /* #x06D5 CYRILLIC SMALL LETTER U */
518 0x0436, /* #x06D6 CYRILLIC SMALL LETTER ZHE */
519 0x0432, /* #x06D7 CYRILLIC SMALL LETTER VE */
520 0x044C, /* #x06D8 CYRILLIC SMALL LETTER SOFT SIGN */
521 0x044B, /* #x06D9 CYRILLIC SMALL LETTER YERU */
522 0x0437, /* #x06DA CYRILLIC SMALL LETTER ZE */
523 0x0448, /* #x06DB CYRILLIC SMALL LETTER SHA */
524 0x044D, /* #x06DC CYRILLIC SMALL LETTER E */
525 0x0449, /* #x06DD CYRILLIC SMALL LETTER SHCHA */
526 0x0447, /* #x06DE CYRILLIC SMALL LETTER CHE */
527 0x044A, /* #x06DF CYRILLIC SMALL LETTER HARD SIGN */
528 0x042E, /* #x06E0 CYRILLIC CAPITAL LETTER YU */
529 0x0410, /* #x06E1 CYRILLIC CAPITAL LETTER A */
530 0x0411, /* #x06E2 CYRILLIC CAPITAL LETTER BE */
531 0x0426, /* #x06E3 CYRILLIC CAPITAL LETTER TSE */
532 0x0414, /* #x06E4 CYRILLIC CAPITAL LETTER DE */
533 0x0415, /* #x06E5 CYRILLIC CAPITAL LETTER IE */
534 0x0424, /* #x06E6 CYRILLIC CAPITAL LETTER EF */
535 0x0413, /* #x06E7 CYRILLIC CAPITAL LETTER GHE */
536 0x0425, /* #x06E8 CYRILLIC CAPITAL LETTER HA */
537 0x0418, /* #x06E9 CYRILLIC CAPITAL LETTER I */
538 0x0419, /* #x06EA CYRILLIC CAPITAL LETTER SHORT I */
539 0x041A, /* #x06EB CYRILLIC CAPITAL LETTER KA */
540 0x041B, /* #x06EC CYRILLIC CAPITAL LETTER EL */
541 0x041C, /* #x06ED CYRILLIC CAPITAL LETTER EM */
542 0x041D, /* #x06EE CYRILLIC CAPITAL LETTER EN */
543 0x041E, /* #x06EF CYRILLIC CAPITAL LETTER O */
544 0x041F, /* #x06F0 CYRILLIC CAPITAL LETTER PE */
545 0x042F, /* #x06F1 CYRILLIC CAPITAL LETTER YA */
546 0x0420, /* #x06F2 CYRILLIC CAPITAL LETTER ER */
547 0x0421, /* #x06F3 CYRILLIC CAPITAL LETTER ES */
548 0x0422, /* #x06F4 CYRILLIC CAPITAL LETTER TE */
549 0x0423, /* #x06F5 CYRILLIC CAPITAL LETTER U */
550 0x0416, /* #x06F6 CYRILLIC CAPITAL LETTER ZHE */
551 0x0412, /* #x06F7 CYRILLIC CAPITAL LETTER VE */
552 0x042C, /* #x06F8 CYRILLIC CAPITAL LETTER SOFT SIGN */
553 0x042B, /* #x06F9 CYRILLIC CAPITAL LETTER YERU */
554 0x0417, /* #x06FA CYRILLIC CAPITAL LETTER ZE */
555 0x0428, /* #x06FB CYRILLIC CAPITAL LETTER SHA */
556 0x042D, /* #x06FC CYRILLIC CAPITAL LETTER E */
557 0x0429, /* #x06FD CYRILLIC CAPITAL LETTER SHCHA */
558 0x0427, /* #x06FE CYRILLIC CAPITAL LETTER CHE */
559 0x042A, /* #x06FF CYRILLIC CAPITAL LETTER HARD SIGN */
560 };
561
464 /* For every key on the keyboard that has a known character correspondence, 562 /* For every key on the keyboard that has a known character correspondence,
465 we define the character-of-keysym property of its XEmacs keysym, and make 563 we define the character-of-keysym property of its XEmacs keysym, and make
466 the default binding for the key be self-insert-command. 564 the default binding for the key be self-insert-command.
467 565
468 The following magic is based on intimate knowledge of some of 566 The following magic is based on intimate knowledge of some of
501 599
502 /* Markus Kuhn's spec says keysyms in the range #x01000100 to #x0110FFFF 600 /* Markus Kuhn's spec says keysyms in the range #x01000100 to #x0110FFFF
503 and only those should correspond directly to Unicode code points, in 601 and only those should correspond directly to Unicode code points, in
504 the range #x100-#x10FFFF; actual implementations can have the Latin 1 602 the range #x100-#x10FFFF; actual implementations can have the Latin 1
505 code points do the same thing with keysyms 603 code points do the same thing with keysyms
506 #x010000A0-#x01000100. */ 604 #x01000000-#x01000100. */
507 605
508 if (keysym >= 0x010000A0 && keysym <= 0x0110FFFF) 606 if (keysym >= 0x01000000 && keysym <= 0x0110FFFF)
509 return Funicode_to_char (make_int(keysym & 0xffffff), Qnil); 607 return Funicode_to_char (make_int(keysym & 0xffffff), Qnil);
510 608
511 if ((keysym & 0xff) < 0xa0) 609 if ((keysym & 0xff) < 0xa0)
512 return Qnil; 610 return Qnil;
513 611
542 USE_CHARSET (charset, ARABIC_ISO8859_6); 640 USE_CHARSET (charset, ARABIC_ISO8859_6);
543 code = keysym & 0x7f; 641 code = keysym & 0x7f;
544 break; 642 break;
545 case 6: /* Cyrillic */ 643 case 6: /* Cyrillic */
546 { 644 {
547 static UExtbyte const cyrillic[] = /* 0x20 - 0x7f */ 645 USE_UNICODE_MAP(keysym, CYRILLIC);
548 {0x00, 0x72, 0x73, 0x71, 0x74, 0x75, 0x76, 0x77,
549 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x00, 0x7e, 0x7f,
550 0x70, 0x22, 0x23, 0x21, 0x24, 0x25, 0x26, 0x27,
551 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x00, 0x2e, 0x2f,
552 0x6e, 0x50, 0x51, 0x66, 0x54, 0x55, 0x64, 0x53,
553 0x65, 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e,
554 0x5f, 0x6f, 0x60, 0x61, 0x62, 0x63, 0x56, 0x52,
555 0x6c, 0x6b, 0x57, 0x68, 0x6d, 0x69, 0x67, 0x6a,
556 0x4e, 0x30, 0x31, 0x46, 0x34, 0x35, 0x44, 0x33,
557 0x45, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e,
558 0x3f, 0x4f, 0x40, 0x41, 0x42, 0x43, 0x36, 0x32,
559 0x4c, 0x4b, 0x37, 0x48, 0x4d, 0x49, 0x47, 0x4a};
560 USE_CHARSET (charset, CYRILLIC_ISO8859_5);
561 code = cyrillic[(keysym & 0x7f) - 0x20];
562 break; 646 break;
563 } 647 }
564 case 7: /* Greek */ 648 case 7: /* Greek */
565 { 649 {
566 static UExtbyte const greek[] = /* 0x20 - 0x7f */ 650 static UExtbyte const greek[] = /* 0x20 - 0x7f */
622 706
623 if (code == 0) 707 if (code == 0)
624 return Qnil; 708 return Qnil;
625 709
626 #ifdef MULE 710 #ifdef MULE
627 return make_char (make_ichar (charset, code, 0)); 711 {
712 Lisp_Object unified = Funicode_to_char
713 (Fchar_to_unicode (make_char (make_ichar (charset, code, 0))), Qnil);
714 if (!NILP (unified))
715 {
716 return unified;
717 }
718 return make_char (make_ichar (charset, code, 0));
719 }
628 #else 720 #else
629 return make_char (code + 0x80); 721 return make_char (code + 0x80);
630 #endif 722 #endif
631 } 723 }
632 724