diff options
Diffstat (limited to 'src/composite.c')
| -rw-r--r-- | src/composite.c | 81 |
1 files changed, 20 insertions, 61 deletions
diff --git a/src/composite.c b/src/composite.c index 6b2fe6a6522..f7b0211ecb8 100644 --- a/src/composite.c +++ b/src/composite.c | |||
| @@ -180,9 +180,7 @@ Lisp_Object composition_temp; | |||
| 180 | If the composition is invalid, return -1. */ | 180 | If the composition is invalid, return -1. */ |
| 181 | 181 | ||
| 182 | int | 182 | int |
| 183 | get_composition_id (charpos, bytepos, nchars, prop, string) | 183 | get_composition_id (int charpos, int bytepos, int nchars, Lisp_Object prop, Lisp_Object string) |
| 184 | int charpos, bytepos, nchars; | ||
| 185 | Lisp_Object prop, string; | ||
| 186 | { | 184 | { |
| 187 | Lisp_Object id, length, components, key, *key_contents; | 185 | Lisp_Object id, length, components, key, *key_contents; |
| 188 | int glyph_len; | 186 | int glyph_len; |
| @@ -429,10 +427,7 @@ get_composition_id (charpos, bytepos, nchars, prop, string) | |||
| 429 | This doesn't check the validity of composition. */ | 427 | This doesn't check the validity of composition. */ |
| 430 | 428 | ||
| 431 | int | 429 | int |
| 432 | find_composition (pos, limit, start, end, prop, object) | 430 | find_composition (int pos, int limit, EMACS_INT *start, EMACS_INT *end, Lisp_Object *prop, Lisp_Object object) |
| 433 | int pos, limit; | ||
| 434 | EMACS_INT *start, *end; | ||
| 435 | Lisp_Object *prop, object; | ||
| 436 | { | 431 | { |
| 437 | Lisp_Object val; | 432 | Lisp_Object val; |
| 438 | 433 | ||
| @@ -470,9 +465,7 @@ find_composition (pos, limit, start, end, prop, object) | |||
| 470 | FROM and TO with property PROP. */ | 465 | FROM and TO with property PROP. */ |
| 471 | 466 | ||
| 472 | static void | 467 | static void |
| 473 | run_composition_function (from, to, prop) | 468 | run_composition_function (int from, int to, Lisp_Object prop) |
| 474 | int from, to; | ||
| 475 | Lisp_Object prop; | ||
| 476 | { | 469 | { |
| 477 | Lisp_Object func; | 470 | Lisp_Object func; |
| 478 | EMACS_INT start, end; | 471 | EMACS_INT start, end; |
| @@ -504,9 +497,7 @@ run_composition_function (from, to, prop) | |||
| 504 | change is deletion, FROM == TO. Otherwise, FROM < TO. */ | 497 | change is deletion, FROM == TO. Otherwise, FROM < TO. */ |
| 505 | 498 | ||
| 506 | void | 499 | void |
| 507 | update_compositions (from, to, check_mask) | 500 | update_compositions (EMACS_INT from, EMACS_INT to, int check_mask) |
| 508 | EMACS_INT from, to; | ||
| 509 | int check_mask; | ||
| 510 | { | 501 | { |
| 511 | Lisp_Object prop; | 502 | Lisp_Object prop; |
| 512 | EMACS_INT start, end; | 503 | EMACS_INT start, end; |
| @@ -612,8 +603,7 @@ update_compositions (from, to, check_mask) | |||
| 612 | top-level copies of them so that none of them are `eq'. */ | 603 | top-level copies of them so that none of them are `eq'. */ |
| 613 | 604 | ||
| 614 | void | 605 | void |
| 615 | make_composition_value_copy (list) | 606 | make_composition_value_copy (Lisp_Object list) |
| 616 | Lisp_Object list; | ||
| 617 | { | 607 | { |
| 618 | Lisp_Object plist, val; | 608 | Lisp_Object plist, val; |
| 619 | 609 | ||
| @@ -638,9 +628,7 @@ make_composition_value_copy (list) | |||
| 638 | indices START and END in STRING. */ | 628 | indices START and END in STRING. */ |
| 639 | 629 | ||
| 640 | void | 630 | void |
| 641 | compose_text (start, end, components, modification_func, string) | 631 | compose_text (int start, int end, Lisp_Object components, Lisp_Object modification_func, Lisp_Object string) |
| 642 | int start, end; | ||
| 643 | Lisp_Object components, modification_func, string; | ||
| 644 | { | 632 | { |
| 645 | Lisp_Object prop; | 633 | Lisp_Object prop; |
| 646 | 634 | ||
| @@ -667,8 +655,7 @@ static Lisp_Object gstring_hash_table; | |||
| 667 | static Lisp_Object gstring_lookup_cache (Lisp_Object); | 655 | static Lisp_Object gstring_lookup_cache (Lisp_Object); |
| 668 | 656 | ||
| 669 | static Lisp_Object | 657 | static Lisp_Object |
| 670 | gstring_lookup_cache (header) | 658 | gstring_lookup_cache (Lisp_Object header) |
| 671 | Lisp_Object header; | ||
| 672 | { | 659 | { |
| 673 | struct Lisp_Hash_Table *h = XHASH_TABLE (gstring_hash_table); | 660 | struct Lisp_Hash_Table *h = XHASH_TABLE (gstring_hash_table); |
| 674 | int i = hash_lookup (h, header, NULL); | 661 | int i = hash_lookup (h, header, NULL); |
| @@ -677,9 +664,7 @@ gstring_lookup_cache (header) | |||
| 677 | } | 664 | } |
| 678 | 665 | ||
| 679 | Lisp_Object | 666 | Lisp_Object |
| 680 | composition_gstring_put_cache (gstring, len) | 667 | composition_gstring_put_cache (Lisp_Object gstring, int len) |
| 681 | Lisp_Object gstring; | ||
| 682 | int len; | ||
| 683 | { | 668 | { |
| 684 | struct Lisp_Hash_Table *h = XHASH_TABLE (gstring_hash_table); | 669 | struct Lisp_Hash_Table *h = XHASH_TABLE (gstring_hash_table); |
| 685 | unsigned hash; | 670 | unsigned hash; |
| @@ -707,8 +692,7 @@ composition_gstring_put_cache (gstring, len) | |||
| 707 | } | 692 | } |
| 708 | 693 | ||
| 709 | Lisp_Object | 694 | Lisp_Object |
| 710 | composition_gstring_from_id (id) | 695 | composition_gstring_from_id (int id) |
| 711 | int id; | ||
| 712 | { | 696 | { |
| 713 | struct Lisp_Hash_Table *h = XHASH_TABLE (gstring_hash_table); | 697 | struct Lisp_Hash_Table *h = XHASH_TABLE (gstring_hash_table); |
| 714 | 698 | ||
| @@ -720,8 +704,7 @@ static Lisp_Object fill_gstring_header (Lisp_Object, Lisp_Object, | |||
| 720 | Lisp_Object); | 704 | Lisp_Object); |
| 721 | 705 | ||
| 722 | int | 706 | int |
| 723 | composition_gstring_p (gstring) | 707 | composition_gstring_p (Lisp_Object gstring) |
| 724 | Lisp_Object gstring; | ||
| 725 | { | 708 | { |
| 726 | Lisp_Object header; | 709 | Lisp_Object header; |
| 727 | int i; | 710 | int i; |
| @@ -752,10 +735,7 @@ composition_gstring_p (gstring) | |||
| 752 | } | 735 | } |
| 753 | 736 | ||
| 754 | int | 737 | int |
| 755 | composition_gstring_width (gstring, from, to, metrics) | 738 | composition_gstring_width (Lisp_Object gstring, int from, int to, struct font_metrics *metrics) |
| 756 | Lisp_Object gstring; | ||
| 757 | int from, to; | ||
| 758 | struct font_metrics *metrics; | ||
| 759 | { | 739 | { |
| 760 | Lisp_Object *glyph; | 740 | Lisp_Object *glyph; |
| 761 | int width = 0; | 741 | int width = 0; |
| @@ -811,8 +791,7 @@ static Lisp_Object gstring_work; | |||
| 811 | static Lisp_Object gstring_work_headers; | 791 | static Lisp_Object gstring_work_headers; |
| 812 | 792 | ||
| 813 | static Lisp_Object | 793 | static Lisp_Object |
| 814 | fill_gstring_header (header, start, end, font_object, string) | 794 | fill_gstring_header (Lisp_Object header, Lisp_Object start, Lisp_Object end, Lisp_Object font_object, Lisp_Object string) |
| 815 | Lisp_Object header, start, end, font_object, string; | ||
| 816 | { | 795 | { |
| 817 | EMACS_INT from, to, from_byte; | 796 | EMACS_INT from, to, from_byte; |
| 818 | EMACS_INT len, i; | 797 | EMACS_INT len, i; |
| @@ -872,8 +851,7 @@ fill_gstring_header (header, start, end, font_object, string) | |||
| 872 | extern void font_fill_lglyph_metrics (Lisp_Object, Lisp_Object); | 851 | extern void font_fill_lglyph_metrics (Lisp_Object, Lisp_Object); |
| 873 | 852 | ||
| 874 | static void | 853 | static void |
| 875 | fill_gstring_body (gstring) | 854 | fill_gstring_body (Lisp_Object gstring) |
| 876 | Lisp_Object gstring; | ||
| 877 | { | 855 | { |
| 878 | Lisp_Object font_object = LGSTRING_FONT (gstring); | 856 | Lisp_Object font_object = LGSTRING_FONT (gstring); |
| 879 | Lisp_Object header = AREF (gstring, 0); | 857 | Lisp_Object header = AREF (gstring, 0); |
| @@ -923,12 +901,7 @@ fill_gstring_body (gstring) | |||
| 923 | object. Otherwise return nil. */ | 901 | object. Otherwise return nil. */ |
| 924 | 902 | ||
| 925 | static Lisp_Object | 903 | static Lisp_Object |
| 926 | autocmp_chars (rule, charpos, bytepos, limit, win, face, string) | 904 | autocmp_chars (Lisp_Object rule, EMACS_INT charpos, EMACS_INT bytepos, EMACS_INT limit, struct window *win, struct face *face, Lisp_Object string) |
| 927 | Lisp_Object rule; | ||
| 928 | EMACS_INT charpos, bytepos, limit; | ||
| 929 | struct window *win; | ||
| 930 | struct face *face; | ||
| 931 | Lisp_Object string; | ||
| 932 | { | 905 | { |
| 933 | int count = SPECPDL_INDEX (); | 906 | int count = SPECPDL_INDEX (); |
| 934 | FRAME_PTR f = XFRAME (win->frame); | 907 | FRAME_PTR f = XFRAME (win->frame); |
| @@ -1020,10 +993,7 @@ static int _work_char; | |||
| 1020 | composition. */ | 993 | composition. */ |
| 1021 | 994 | ||
| 1022 | void | 995 | void |
| 1023 | composition_compute_stop_pos (cmp_it, charpos, bytepos, endpos, string) | 996 | composition_compute_stop_pos (struct composition_it *cmp_it, EMACS_INT charpos, EMACS_INT bytepos, EMACS_INT endpos, Lisp_Object string) |
| 1024 | struct composition_it *cmp_it; | ||
| 1025 | EMACS_INT charpos, bytepos, endpos; | ||
| 1026 | Lisp_Object string; | ||
| 1027 | { | 997 | { |
| 1028 | EMACS_INT start, end, c; | 998 | EMACS_INT start, end, c; |
| 1029 | Lisp_Object prop, val; | 999 | Lisp_Object prop, val; |
| @@ -1253,12 +1223,7 @@ composition_compute_stop_pos (cmp_it, charpos, bytepos, endpos, string) | |||
| 1253 | CMP_IT->stop_pos, and return 0. */ | 1223 | CMP_IT->stop_pos, and return 0. */ |
| 1254 | 1224 | ||
| 1255 | int | 1225 | int |
| 1256 | composition_reseat_it (cmp_it, charpos, bytepos, endpos, w, face, string) | 1226 | composition_reseat_it (struct composition_it *cmp_it, EMACS_INT charpos, EMACS_INT bytepos, EMACS_INT endpos, struct window *w, struct face *face, Lisp_Object string) |
| 1257 | struct composition_it *cmp_it; | ||
| 1258 | EMACS_INT charpos, bytepos, endpos; | ||
| 1259 | struct window *w; | ||
| 1260 | struct face *face; | ||
| 1261 | Lisp_Object string; | ||
| 1262 | { | 1227 | { |
| 1263 | if (endpos <= charpos) | 1228 | if (endpos <= charpos) |
| 1264 | { | 1229 | { |
| @@ -1417,10 +1382,7 @@ composition_reseat_it (cmp_it, charpos, bytepos, endpos, w, face, string) | |||
| 1417 | the cluster, or -1 if the composition is somehow broken. */ | 1382 | the cluster, or -1 if the composition is somehow broken. */ |
| 1418 | 1383 | ||
| 1419 | int | 1384 | int |
| 1420 | composition_update_it (cmp_it, charpos, bytepos, string) | 1385 | composition_update_it (struct composition_it *cmp_it, EMACS_INT charpos, EMACS_INT bytepos, Lisp_Object string) |
| 1421 | struct composition_it *cmp_it; | ||
| 1422 | EMACS_INT charpos, bytepos; | ||
| 1423 | Lisp_Object string; | ||
| 1424 | { | 1386 | { |
| 1425 | int i, c; | 1387 | int i, c; |
| 1426 | 1388 | ||
| @@ -1543,9 +1505,7 @@ struct position_record | |||
| 1543 | the composition, and return 1. Otherwise, return 0. */ | 1505 | the composition, and return 1. Otherwise, return 0. */ |
| 1544 | 1506 | ||
| 1545 | static int | 1507 | static int |
| 1546 | find_automatic_composition (pos, limit, start, end, gstring, string) | 1508 | find_automatic_composition (EMACS_INT pos, EMACS_INT limit, EMACS_INT *start, EMACS_INT *end, Lisp_Object *gstring, Lisp_Object string) |
| 1547 | EMACS_INT pos, limit, *start, *end; | ||
| 1548 | Lisp_Object *gstring, string; | ||
| 1549 | { | 1509 | { |
| 1550 | EMACS_INT head, tail, stop; | 1510 | EMACS_INT head, tail, stop; |
| 1551 | /* Limit to check a composition after POS. */ | 1511 | /* Limit to check a composition after POS. */ |
| @@ -1716,8 +1676,7 @@ find_automatic_composition (pos, limit, start, end, gstring, string) | |||
| 1716 | to NEW_PT. */ | 1676 | to NEW_PT. */ |
| 1717 | 1677 | ||
| 1718 | int | 1678 | int |
| 1719 | composition_adjust_point (last_pt, new_pt) | 1679 | composition_adjust_point (EMACS_INT last_pt, EMACS_INT new_pt) |
| 1720 | EMACS_INT last_pt, new_pt; | ||
| 1721 | { | 1680 | { |
| 1722 | EMACS_INT charpos, bytepos, startpos, beg, end, pos; | 1681 | EMACS_INT charpos, bytepos, startpos, beg, end, pos; |
| 1723 | Lisp_Object val; | 1682 | Lisp_Object val; |
| @@ -1974,7 +1933,7 @@ See `find-composition' for more details. */) | |||
| 1974 | 1933 | ||
| 1975 | 1934 | ||
| 1976 | void | 1935 | void |
| 1977 | syms_of_composite () | 1936 | syms_of_composite (void) |
| 1978 | { | 1937 | { |
| 1979 | int i; | 1938 | int i; |
| 1980 | 1939 | ||