From 138343f4f82e211fad68338633970d4d6657ba20 Mon Sep 17 00:00:00 2001 From: Rene Gollent Date: Sun, 27 Sep 2009 23:20:19 +0000 Subject: [PATCH] Patch by Joshua R. Elsasser: Implement DECALN escape sequence. Resolves ticket #4658. Thanks! git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33325 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/terminal/BasicTerminalBuffer.cpp | 22 ++++++++++++++++++++++ src/apps/terminal/BasicTerminalBuffer.h | 1 + src/apps/terminal/TermParse.cpp | 5 +---- 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/src/apps/terminal/BasicTerminalBuffer.cpp b/src/apps/terminal/BasicTerminalBuffer.cpp index 219afcd92b..f33b898a7b 100644 --- a/src/apps/terminal/BasicTerminalBuffer.cpp +++ b/src/apps/terminal/BasicTerminalBuffer.cpp @@ -578,6 +578,28 @@ BasicTerminalBuffer::InsertChar(UTF8Char c, uint32 width, uint32 attributes) } +void +BasicTerminalBuffer::FillScreen(UTF8Char c, uint32 width, uint32 attributes) +{ + // TODO: Check if this method can be removed completely + //int width = CodeConv::UTF8GetFontWidth(c.bytes); + if ((int32)width == FULL_WIDTH) + attributes |= A_WIDTH; + + fSoftWrappedCursor = false; + + for (int32 y = 0; y < fHeight; y++) { + TerminalLine *line = _LineAt(y); + for (int32 x = 0; x < fWidth / (int32)width; x++) { + line->cells[x].character = c; + line->cells[x].attributes = attributes; + } + line->length = fWidth / width; + } + + _Invalidate(0, fHeight - 1); +} + void BasicTerminalBuffer::InsertCR() { diff --git a/src/apps/terminal/BasicTerminalBuffer.h b/src/apps/terminal/BasicTerminalBuffer.h index 3b134b8d00..08ef1d844c 100644 --- a/src/apps/terminal/BasicTerminalBuffer.h +++ b/src/apps/terminal/BasicTerminalBuffer.h @@ -103,6 +103,7 @@ public: uint32 attributes); inline void InsertChar(const char* c, int32 length, uint32 width, uint32 attributes); + void FillScreen(UTF8Char c, uint32 width, uint32 attr); void InsertCR(); void InsertLF(); diff --git a/src/apps/terminal/TermParse.cpp b/src/apps/terminal/TermParse.cpp index f385ec2ec4..87a027619a 100644 --- a/src/apps/terminal/TermParse.cpp +++ b/src/apps/terminal/TermParse.cpp @@ -821,10 +821,7 @@ TermParse::EscParse() case CASE_DECALN: /* DECALN */ - // if(screen->cursor_state) - // HideCursor(); - // ScrnRefresh(screen, 0, 0, screen->max_row + 1, - // screen->max_col + 1, False); + fBuffer->FillScreen(UTF8Char('E'), 1, 0); parsestate = groundtable; break;