diff options
| author | Kenichi Handa | 2002-03-01 01:48:37 +0000 |
|---|---|---|
| committer | Kenichi Handa | 2002-03-01 01:48:37 +0000 |
| commit | 9332ea0315918e91b17b1deb619a5503468ac1f7 (patch) | |
| tree | 1b689df957d55ab79e39b02d55895f520de9cf97 /src | |
| parent | f4926ee83540d77f35cc9a9251bc75025caea237 (diff) | |
| download | emacs-9332ea0315918e91b17b1deb619a5503468ac1f7.tar.gz emacs-9332ea0315918e91b17b1deb619a5503468ac1f7.zip | |
Include "buffer.h" and "character.h".
(encode_terminal_code): Adjusted for the new code-conversion API.
(write_glyphs): Likewise.
(produce_glyphs): Call CHAR_WIDTH instead of CHARSET_WIDTH.
Diffstat (limited to 'src')
| -rw-r--r-- | src/term.c | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/src/term.c b/src/term.c index 19a1afa8c12..9a66b6b7e25 100644 --- a/src/term.c +++ b/src/term.c | |||
| @@ -29,6 +29,8 @@ Boston, MA 02111-1307, USA. */ | |||
| 29 | #include "termchar.h" | 29 | #include "termchar.h" |
| 30 | #include "termopts.h" | 30 | #include "termopts.h" |
| 31 | #include "lisp.h" | 31 | #include "lisp.h" |
| 32 | #include "buffer.h" | ||
| 33 | #include "character.h" | ||
| 32 | #include "charset.h" | 34 | #include "charset.h" |
| 33 | #include "coding.h" | 35 | #include "coding.h" |
| 34 | #include "keyboard.h" | 36 | #include "keyboard.h" |
| @@ -872,12 +874,13 @@ encode_terminal_code (src, dst, src_len, dst_len, consumed) | |||
| 872 | } | 874 | } |
| 873 | } | 875 | } |
| 874 | 876 | ||
| 875 | result = encode_coding (coding, buf, dst, len, dst_end - dst); | 877 | coding->source = buf; |
| 878 | coding->destination = dst; | ||
| 879 | coding->dst_bytes = dst_end - dst; | ||
| 880 | encode_coding_object (coding, Qnil, 0, 0, 1, len, Qnil); | ||
| 876 | len -= coding->consumed; | 881 | len -= coding->consumed; |
| 877 | dst += coding->produced; | 882 | dst += coding->produced; |
| 878 | if (result == CODING_FINISH_INSUFFICIENT_DST | 883 | if (coding->result == CODING_RESULT_INSUFFICIENT_DST) |
| 879 | || (result == CODING_FINISH_INSUFFICIENT_SRC | ||
| 880 | && len > dst_end - dst)) | ||
| 881 | /* The remaining output buffer is too short. We must | 884 | /* The remaining output buffer is too short. We must |
| 882 | break the loop here without increasing SRC so that the | 885 | break the loop here without increasing SRC so that the |
| 883 | next call of this function starts from the same glyph. */ | 886 | next call of this function starts from the same glyph. */ |
| @@ -981,8 +984,10 @@ write_glyphs (string, len) | |||
| 981 | if (CODING_REQUIRE_FLUSHING (&terminal_coding)) | 984 | if (CODING_REQUIRE_FLUSHING (&terminal_coding)) |
| 982 | { | 985 | { |
| 983 | terminal_coding.mode |= CODING_MODE_LAST_BLOCK; | 986 | terminal_coding.mode |= CODING_MODE_LAST_BLOCK; |
| 984 | encode_coding (&terminal_coding, "", conversion_buffer, | 987 | terminal_coding.source = (unsigned char *) ""; |
| 985 | 0, conversion_buffer_size); | 988 | terminal_coding.destination = conversion_buffer; |
| 989 | terminal_coding.dst_bytes = conversion_buffer_size; | ||
| 990 | encode_coding_object (&terminal_coding, Qnil, 0, 0, 0, 0, Qnil); | ||
| 986 | if (terminal_coding.produced > 0) | 991 | if (terminal_coding.produced > 0) |
| 987 | { | 992 | { |
| 988 | fwrite (conversion_buffer, 1, terminal_coding.produced, stdout); | 993 | fwrite (conversion_buffer, 1, terminal_coding.produced, stdout); |
| @@ -1713,13 +1718,7 @@ produce_glyphs (it) | |||
| 1713 | } | 1718 | } |
| 1714 | else | 1719 | else |
| 1715 | { | 1720 | { |
| 1716 | /* A multi-byte character. The display width is fixed for all | 1721 | it->pixel_width = CHAR_WIDTH (it->c); |
| 1717 | characters of the set. Some of the glyphs may have to be | ||
| 1718 | ignored because they are already displayed in a continued | ||
| 1719 | line. */ | ||
| 1720 | int charset = CHAR_CHARSET (it->c); | ||
| 1721 | |||
| 1722 | it->pixel_width = CHARSET_WIDTH (charset); | ||
| 1723 | it->nglyphs = it->pixel_width; | 1722 | it->nglyphs = it->pixel_width; |
| 1724 | 1723 | ||
| 1725 | if (it->glyph_row) | 1724 | if (it->glyph_row) |