Handle more pseudoÃ-graphic characters and ways of using them. This gets aptitude (from debianÃ) displaying properly and should also fix midnight commander.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38139 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -330,6 +330,10 @@ TermParse::EscParse()
|
|||||||
int *groundtable = gUTF8GroundTable;
|
int *groundtable = gUTF8GroundTable;
|
||||||
int *parsestate = gUTF8GroundTable;
|
int *parsestate = gUTF8GroundTable;
|
||||||
|
|
||||||
|
/* Handle switch between G0 and G1 character sets */
|
||||||
|
int *alternateParseTable = gUTF8GroundTable;
|
||||||
|
bool shifted_in = false;
|
||||||
|
|
||||||
int32 srcLen;
|
int32 srcLen;
|
||||||
int32 dstLen;
|
int32 dstLen;
|
||||||
long dummyState = 0;
|
long dummyState = 0;
|
||||||
@@ -453,6 +457,9 @@ TermParse::EscParse()
|
|||||||
case CASE_PRINT_GRA:
|
case CASE_PRINT_GRA:
|
||||||
/* "Special characters and line drawing" enabled by \E(0 */
|
/* "Special characters and line drawing" enabled by \E(0 */
|
||||||
switch (c) {
|
switch (c) {
|
||||||
|
case 'a':
|
||||||
|
fBuffer->InsertChar("\xE2\x96\x92",3,fAttr);
|
||||||
|
break;
|
||||||
case 'j':
|
case 'j':
|
||||||
fBuffer->InsertChar("\xE2\x94\x98",3,fAttr);
|
fBuffer->InsertChar("\xE2\x94\x98",3,fAttr);
|
||||||
break;
|
break;
|
||||||
@@ -465,9 +472,26 @@ TermParse::EscParse()
|
|||||||
case 'm':
|
case 'm':
|
||||||
fBuffer->InsertChar("\xE2\x94\x94",3,fAttr);
|
fBuffer->InsertChar("\xE2\x94\x94",3,fAttr);
|
||||||
break;
|
break;
|
||||||
|
case 'n':
|
||||||
|
fBuffer->InsertChar("\xE2\x94\xBC",3,fAttr);
|
||||||
|
break;
|
||||||
case 'q':
|
case 'q':
|
||||||
|
fBuffer->InsertChar("\xE2\x94\x80",3,fAttr);
|
||||||
|
break;
|
||||||
|
case 't':
|
||||||
|
fBuffer->InsertChar("\xE2\x94\x9C",3,fAttr);
|
||||||
|
break;
|
||||||
|
case 'u':
|
||||||
|
fBuffer->InsertChar("\xE2\x94\xA4",3,fAttr);
|
||||||
|
break;
|
||||||
|
case 'v':
|
||||||
|
fBuffer->InsertChar("\xE2\x94\xB4",3,fAttr);
|
||||||
|
break;
|
||||||
|
case 'w':
|
||||||
|
fBuffer->InsertChar("\xE2\x94\xAC",3,fAttr);
|
||||||
break;
|
break;
|
||||||
case 'x':
|
case 'x':
|
||||||
|
fBuffer->InsertChar("\xE2\x94\x82",3,fAttr);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
fBuffer->InsertChar((char)c, fAttr);
|
fBuffer->InsertChar((char)c, fAttr);
|
||||||
@@ -542,11 +566,29 @@ TermParse::EscParse()
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case CASE_SCS_STATE:
|
case CASE_SCS_STATE:
|
||||||
if (_NextParseChar() == '0')
|
{
|
||||||
parsestate = gLineDrawTable;
|
char page = _NextParseChar();
|
||||||
else
|
|
||||||
parsestate = groundtable;
|
int* newTable = gUTF8GroundTable;
|
||||||
|
if (page == '0')
|
||||||
|
newTable = gLineDrawTable;
|
||||||
|
|
||||||
|
if (c == '(') {
|
||||||
|
if (shifted_in)
|
||||||
|
alternateParseTable = newTable;
|
||||||
|
else
|
||||||
|
groundtable = newTable;
|
||||||
|
} else if (c == ')') {
|
||||||
|
if (!shifted_in)
|
||||||
|
alternateParseTable = newTable;
|
||||||
|
else
|
||||||
|
groundtable = newTable;
|
||||||
|
}
|
||||||
|
|
||||||
|
parsestate = groundtable;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case CASE_GROUND_STATE:
|
case CASE_GROUND_STATE:
|
||||||
/* exit ignore mode */
|
/* exit ignore mode */
|
||||||
@@ -585,9 +627,21 @@ TermParse::EscParse()
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case CASE_SI:
|
case CASE_SI:
|
||||||
|
/* shift in (to G1 charset) */
|
||||||
|
if (shifted_in == false) {
|
||||||
|
int* tmp = alternateParseTable;
|
||||||
|
alternateParseTable = parsestate;
|
||||||
|
parsestate = tmp;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CASE_SO:
|
case CASE_SO:
|
||||||
|
/* shift out (to G0 charset) */
|
||||||
|
if (shifted_in == true) {
|
||||||
|
int* tmp = alternateParseTable;
|
||||||
|
alternateParseTable = parsestate;
|
||||||
|
parsestate = tmp;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CASE_SCR_STATE: // ESC #
|
case CASE_SCR_STATE: // ESC #
|
||||||
|
|||||||
@@ -4849,7 +4849,7 @@ CASE_PRINT,
|
|||||||
CASE_PRINT,
|
CASE_PRINT,
|
||||||
/* ` a b c */
|
/* ` a b c */
|
||||||
CASE_PRINT,
|
CASE_PRINT,
|
||||||
CASE_PRINT,
|
CASE_PRINT_GRA,
|
||||||
CASE_PRINT,
|
CASE_PRINT,
|
||||||
CASE_PRINT,
|
CASE_PRINT,
|
||||||
/* d e f g */
|
/* d e f g */
|
||||||
@@ -4865,7 +4865,7 @@ CASE_PRINT_GRA,
|
|||||||
/* l m n o */
|
/* l m n o */
|
||||||
CASE_PRINT_GRA,
|
CASE_PRINT_GRA,
|
||||||
CASE_PRINT_GRA,
|
CASE_PRINT_GRA,
|
||||||
CASE_PRINT,
|
CASE_PRINT_GRA,
|
||||||
CASE_PRINT,
|
CASE_PRINT,
|
||||||
/* p q r s */
|
/* p q r s */
|
||||||
CASE_PRINT,
|
CASE_PRINT,
|
||||||
@@ -4873,10 +4873,10 @@ CASE_PRINT_GRA,
|
|||||||
CASE_PRINT,
|
CASE_PRINT,
|
||||||
CASE_PRINT,
|
CASE_PRINT,
|
||||||
/* t u v w */
|
/* t u v w */
|
||||||
CASE_PRINT,
|
CASE_PRINT_GRA,
|
||||||
CASE_PRINT,
|
CASE_PRINT_GRA,
|
||||||
CASE_PRINT,
|
CASE_PRINT_GRA,
|
||||||
CASE_PRINT,
|
CASE_PRINT_GRA,
|
||||||
/* x y z { */
|
/* x y z { */
|
||||||
CASE_PRINT_GRA,
|
CASE_PRINT_GRA,
|
||||||
CASE_PRINT,
|
CASE_PRINT,
|
||||||
|
|||||||
Reference in New Issue
Block a user