1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-03 20:42:48 -05:00

First phase of porting. pterm now compiles and runs under Linux+gtk.

The current pty.c backend is temporarily a loopback device for
terminal emulator testing, the display handling is only just enough
to show that terminal.c is functioning, the keyboard handling is
laughable, and most features are absent. Next step: bring output and
input up to a plausibly working state, and put a real pty on the
back to create a vaguely usable prototype. Oh, and a scrollbar would
be nice too.
In _theory_ the Windows builds should still work fine after this...

[originally from svn r2010]
This commit is contained in:
Simon Tatham
2002-10-09 18:09:42 +00:00
parent 268213483c
commit 6d0e9b205d
24 changed files with 774 additions and 56 deletions

View File

@ -1042,6 +1042,9 @@ static void term_print_finish(void)
int len, size;
char c;
if (!printing && !only_printing)
return; /* we need do nothing */
term_print_flush();
while ((size = bufchain_size(&printer_buf)) > 0) {
bufchain_prefix(&printer_buf, &data, &len);
@ -1072,6 +1075,7 @@ void term_out(void)
unget = -1;
chars = NULL; /* placate compiler warnings */
while (nchars > 0 || bufchain_size(&inbuf) > 0) {
if (unget == -1) {
if (nchars == 0) {
@ -3176,16 +3180,14 @@ static void clipme(pos top, pos bottom, int rect)
unsigned char buf[4];
WCHAR wbuf[4];
int rv;
if (IsDBCSLeadByteEx(font_codepage, (BYTE) c)) {
if (is_dbcs_leadbyte(font_codepage, (BYTE) c)) {
buf[0] = c;
buf[1] = (unsigned char) ldata[top.x + 1];
rv = MultiByteToWideChar(font_codepage,
0, buf, 2, wbuf, 4);
rv = mb_to_wc(font_codepage, 0, buf, 2, wbuf, 4);
top.x++;
} else {
buf[0] = c;
rv = MultiByteToWideChar(font_codepage,
0, buf, 1, wbuf, 4);
rv = mb_to_wc(font_codepage, 0, buf, 1, wbuf, 4);
}
if (rv > 0) {