Ticket #4658: term-decaln.patch

File term-decaln.patch, 2.1 KB (added by joshe, 15 years ago)

Implement DECALN

  • src/apps/terminal/BasicTerminalBuffer.cpp

    commit e471b082920dcbea20a6d2ad2dc803dc15f01dcf
    Author: Joshua R. Elsasser <joshua@elsasser.org>
    Date:   Sun Sep 27 12:40:58 2009 +0000
    
        Implement DECALN sequence.
    
    diff --git src/apps/terminal/BasicTerminalBuffer.cpp src/apps/terminal/BasicTerminalBuffer.cpp
    index 9b39e7a..8bddca3 100644
    BasicTerminalBuffer::InsertChar(UTF8Char c, uint32 width, uint32 attributes)  
    587587
    588588
    589589void
     590BasicTerminalBuffer::FillScreen(UTF8Char c, uint32 width, uint32 attributes)
     591{
     592    // TODO: Check if this method can be removed completely
     593    //int width = CodeConv::UTF8GetFontWidth(c.bytes);
     594    if ((int32)width == FULL_WIDTH)
     595        attributes |= A_WIDTH;
     596
     597    fSoftWrappedCursor = false;
     598
     599    for (int32 y = 0; y < fHeight; y++) {
     600        TerminalLine *line = _LineAt(y);
     601        for (int32 x = 0; x < fWidth / (int32)width; x++) {
     602            line->cells[x].character = c;
     603            line->cells[x].attributes = attributes;
     604        }
     605        line->length = fWidth / width;
     606    }
     607
     608    _Invalidate(0, fHeight - 1);
     609}
     610
     611void
    590612BasicTerminalBuffer::InsertCR()
    591613{
    592614    _LineAt(fCursor.y)->softBreak = false;
  • src/apps/terminal/BasicTerminalBuffer.h

    diff --git src/apps/terminal/BasicTerminalBuffer.h src/apps/terminal/BasicTerminalBuffer.h
    index 2d57aaf..0d9fe20 100644
    public:  
    103103                                    uint32 attributes);
    104104    inline  void                InsertChar(const char* c, int32 length,
    105105                                    uint32 width, uint32 attributes);
     106            void                FillScreen(UTF8Char c, uint32 width, uint32 attr);
    106107
    107108            void                InsertCR();
    108109            void                InsertLF();
  • src/apps/terminal/TermParse.cpp

    diff --git src/apps/terminal/TermParse.cpp src/apps/terminal/TermParse.cpp
    index 606f7be..6c8bde0 100644
    TermParse::EscParse()  
    818818
    819819                case CASE_DECALN:
    820820                    /* DECALN */
    821                     //      if(screen->cursor_state)
    822                     //  HideCursor();
    823                     //      ScrnRefresh(screen, 0, 0, screen->max_row + 1,
    824                     //        screen->max_col + 1, False);
     821                    fBuffer->FillScreen(UTF8Char('E'), 1, 0);
    825822                    parsestate = groundtable;
    826823                    break;
    827824