| 344 |
} |
} |
| 345 |
|
|
| 346 |
void SendCSIstr(char *str, int len) { |
void SendCSIstr(char *str, int len) { |
| 347 |
if (str == NULL || len <= 0) |
int l; |
| 348 |
|
|
| 349 |
|
if (str == NULL || len < 0) |
| 350 |
return; |
return; |
| 351 |
|
|
| 352 |
|
if (len == 0) { |
| 353 |
|
l = strlen(str); |
| 354 |
|
} |
| 355 |
|
else { |
| 356 |
|
l = len; |
| 357 |
|
} |
| 358 |
|
|
| 359 |
if (Send8BitMode) |
if (Send8BitMode) |
| 360 |
CommBinaryOut(&cv,"\233", 1); |
CommBinaryOut(&cv,"\233", 1); |
| 361 |
else |
else |
| 362 |
CommBinaryOut(&cv,"\033[", 2); |
CommBinaryOut(&cv,"\033[", 2); |
| 363 |
|
|
| 364 |
CommBinaryOut(&cv, str, len); |
CommBinaryOut(&cv, str, l); |
| 365 |
} |
} |
| 366 |
|
|
| 367 |
void SendOSCstr(char *str, int len) { |
void SendOSCstr(char *str, int len) { |
| 368 |
|
int l; |
| 369 |
|
|
| 370 |
if (str == NULL || len <= 0) |
if (str == NULL || len <= 0) |
| 371 |
return; |
return; |
| 372 |
|
|
| 373 |
|
if (len == 0) { |
| 374 |
|
l = strlen(str); |
| 375 |
|
} |
| 376 |
|
else { |
| 377 |
|
l = len; |
| 378 |
|
} |
| 379 |
|
|
| 380 |
if (Send8BitMode) { |
if (Send8BitMode) { |
| 381 |
CommBinaryOut(&cv,"\235", 1); |
CommBinaryOut(&cv,"\235", 1); |
| 382 |
CommBinaryOut(&cv, str, len); |
CommBinaryOut(&cv, str, l); |
| 383 |
CommBinaryOut(&cv,"\234", 1); |
CommBinaryOut(&cv,"\234", 1); |
| 384 |
} |
} |
| 385 |
else { |
else { |
| 386 |
CommBinaryOut(&cv,"\033]", 2); |
CommBinaryOut(&cv,"\033]", 2); |
| 387 |
CommBinaryOut(&cv, str, len); |
CommBinaryOut(&cv, str, l); |
| 388 |
CommBinaryOut(&cv,"\033\\", 2); |
CommBinaryOut(&cv,"\033\\", 2); |
| 389 |
} |
} |
| 390 |
|
|
| 1666 |
switch (Param[1]) { |
switch (Param[1]) { |
| 1667 |
case 5: |
case 5: |
| 1668 |
/* Device Status Report -> Ready */ |
/* Device Status Report -> Ready */ |
| 1669 |
SendCSIstr("0n", 2); |
SendCSIstr("0n", 0); |
| 1670 |
break; |
break; |
| 1671 |
case 6: |
case 6: |
| 1672 |
/* Cursor Position Report */ |
/* Cursor Position Report */ |
| 1943 |
case 14: /* get window size??? */ |
case 14: /* get window size??? */ |
| 1944 |
if (ts.WindowFlag & WF_WINDOWREPORT) { |
if (ts.WindowFlag & WF_WINDOWREPORT) { |
| 1945 |
/* this is not actual window size */ |
/* this is not actual window size */ |
| 1946 |
SendCSIstr("4;640;480t", 10); |
SendCSIstr("4;640;480t", 0); |
| 1947 |
} |
} |
| 1948 |
break; |
break; |
| 1949 |
case 18: /* get terminal size */ |
case 18: /* get terminal size */ |
| 1987 |
SendOSCstr(Report, len); |
SendOSCstr(Report, len); |
| 1988 |
break; |
break; |
| 1989 |
default: // IdTitleReportEmpty: |
default: // IdTitleReportEmpty: |
| 1990 |
SendOSCstr("L", 1); |
SendOSCstr("L", 0); |
| 1991 |
break; |
break; |
| 1992 |
} |
} |
| 1993 |
break; |
break; |
| 2018 |
SendOSCstr(Report, len); |
SendOSCstr(Report, len); |
| 2019 |
break; |
break; |
| 2020 |
default: // IdTitleReportEmpty: |
default: // IdTitleReportEmpty: |
| 2021 |
SendOSCstr("l", 1); |
SendOSCstr("l", 0); |
| 2022 |
break; |
break; |
| 2023 |
} |
} |
| 2024 |
break; |
break; |
| 2030 |
switch (b) { |
switch (b) { |
| 2031 |
case 'c': /* second terminal report (Secondary DA) */ |
case 'c': /* second terminal report (Secondary DA) */ |
| 2032 |
if (Param[1] < 1) { |
if (Param[1] < 1) { |
| 2033 |
SendCSIstr(">32;100;2c", 10); /* VT382 */ |
SendCSIstr(">32;100;2c", 0); /* VT382 */ |
| 2034 |
} |
} |
| 2035 |
break; |
break; |
| 2036 |
case 'J': |
case 'J': |
| 2360 |
switch (Param[1]) { |
switch (Param[1]) { |
| 2361 |
case 53: |
case 53: |
| 2362 |
/* Locator Device Status Report -> Ready */ |
/* Locator Device Status Report -> Ready */ |
| 2363 |
SendCSIstr("?50n", 4); |
SendCSIstr("?50n", 0); |
| 2364 |
break; |
break; |
| 2365 |
} |
} |
| 2366 |
} |
} |
| 4003 |
|
|
| 4004 |
if (focus) { |
if (focus) { |
| 4005 |
// Focus In |
// Focus In |
| 4006 |
SendCSIstr("I", 1); |
SendCSIstr("I", 0); |
| 4007 |
} else { |
} else { |
| 4008 |
// Focus Out |
// Focus Out |
| 4009 |
SendCSIstr("O", 1); |
SendCSIstr("O", 0); |
| 4010 |
} |
} |
| 4011 |
} |
} |
| 4012 |
|
|