Пример #1
0
 internal void ed(int mode)
 {
     switch (mode)
     {
         case 0:
             for (int i = _cursor.line + 1; i < _size.line; i++)
                 for (int j = 0; j < _size.col; j++)
                     this[i, j] = new TerminalCharSpace(bg);
             el(0);
             break;
         case 1:
             for (int i = 0; i < _cursor.line; i++)
                 for (int j = 0; j < _size.col; j++)
                     this[i, j] = new TerminalCharSpace(bg);
             el(1);
             break;
         case 2:
             for (int i = 0; i < _size.line; i++)
                 for (int j = 0; j < _size.col; j++)
                     this[i, j] = new TerminalCharSpace(bg);
             break;
     }
 }
Пример #2
0
 internal void del()
 {
     this[_cursor] = new TerminalCharSpace(bg);
 }
Пример #3
0
 internal TerminalChar this[int line, int col]
 {
     get
     {
         return _char[line, col];
     }
     set
     {
         int l = col, r = col;
         if (!value.Partial && _char[line, col].Partial)
         {
             _char[line, col - 1] = new TerminalCharSpace(((TerminalCharSpace)_char[line, col - 1]).bg);
             l = col - 1;
         }
         if (_char[line, col].DoubleWidth && !value.DoubleWidth)
         {
             _char[line, col + 1] = new TerminalCharSpace(((TerminalCharSpace)_char[line, col]).bg);
             r = col + 1;
         }
         _char[line, col] = value;
         if (value.DoubleWidth)
         {
             r = col + 1;
             if (_char[line, col + 1].DoubleWidth)
             {
                 _char[line, col + 2] = new TerminalCharSpace(((TerminalCharSpace)_char[line, col + 1]).bg);
                 r = col + 2;
             }
             _char[line, col + 1] = TerminalChar.UnVisible;
         }
         _parent.invalidate(line, line, l, r);
     }
 }
Пример #4
0
 public void clear()
 {
     for (int i = 0; i < _size.line; i++)
     {
         for (int j = 0; j < _size.col; j++)
         {
             _char[i, j] = _char[i, j] = new TerminalCharSpace(bg);
         }
     }
     _parent.invalidate(0, _size.line - 1, 0, _size.col - 1);
 }
Пример #5
0
            internal TerminalChars(TerminalEmulator parent, int cols, int lines, TerminalChars src)
            {
                _parent = parent;
                _size.col = cols;
                _size.line = lines;
                _char = new TerminalChar[_size.line, _size.col];

                am = src.am;

                fg = src.fg;
                bg = src.bg;

                for (int i = 0; i < Math.Min(_size.line, src._size.line); i++)
                {
                    for (int j = 0; j < Math.Min(_size.col, src._size.col); j++)
                    {
                        _char[i, j] = src._char[i, j];
                    }
                    for (int j = src._size.col; j < _size.col; j++)
                    {
                        _char[i, j] = new TerminalCharSpace(bg);
                    }
                }
                for (int i = src._size.line; i < _size.line; i++)
                {
                    for (int j = 0; j < _size.col; j++)
                    {
                        _char[i, j] = _char[i, j] = new TerminalCharSpace(bg);
                    }
                }
            }