Lines Matching refs:line

288 	TerminalLine* line = _HistoryLineAt(row, lineBuffer);  in IsFullWidthChar()  local
289 return line != NULL && column > 0 && column < line->length in IsFullWidthChar()
290 && line->cells[column - 1].attributes.IsWidth(); in IsFullWidthChar()
299 TerminalLine* line = _HistoryLineAt(row, lineBuffer); in GetChar() local
300 if (line == NULL) in GetChar()
303 if (column < 0 || column >= line->length) in GetChar()
306 if (column > 0 && line->cells[column - 1].attributes.IsWidth()) in GetChar()
309 TerminalCell& cell = line->cells[column]; in GetChar()
322 TerminalLine* line = _HistoryLineAt(row, lineBuffer); in GetCellAttributes() local
323 if (line == NULL || column < 0) in GetCellAttributes()
328 TerminalCell& cell = line->cells[c]; in GetCellAttributes()
342 TerminalLine* line = _HistoryLineAt(row, lineBuffer); in GetString() local
343 if (line == NULL) in GetString()
346 if (lastColumn >= line->length) in GetString()
347 lastColumn = line->length - 1; in GetString()
351 attributes = line->cells[column].attributes; in GetString()
354 TerminalCell& cell = line->cells[column]; in GetString()
385 TerminalLine* line = _GetPartialLineString(string, pos.y, pos.x, in GetStringFromRegion() local
387 if (line != NULL && !line->softBreak) in GetStringFromRegion()
408 TerminalLine* line = _HistoryLineAt(y, lineBuffer); in FindWord() local
409 if (line == NULL || x < 0 || x >= fWidth) in FindWord()
412 if (x >= line->length) { in FindWord()
417 _start.SetTo(line->length, y); in FindWord()
422 if (x > 0 && line->cells[x - 1].attributes.IsWidth()) in FindWord()
426 int type = classifier->Classify(line->cells[x].character); in FindWord()
434 TermPos end(x + (line->cells[x].attributes.IsWidth() in FindWord()
438 if (!_PreviousLinePos(lineBuffer, line, previousPos) in FindWord()
439 || classifier->Classify(line->cells[previousPos.x].character) in FindWord()
448 line = _HistoryLineAt(end.y, lineBuffer); in FindWord()
452 if (!_NormalizeLinePos(lineBuffer, line, nextPos)) in FindWord()
455 if (classifier->Classify(line->cells[nextPos.x].character) != type) in FindWord()
458 nextPos.x += line->cells[nextPos.x].attributes.IsWidth() in FindWord()
473 TerminalLine* line = _HistoryLineAt(pos.y, lineBuffer); in PreviousLinePos() local
474 if (line == NULL || pos.x < 0 || pos.x >= fWidth) in PreviousLinePos()
477 return _PreviousLinePos(lineBuffer, line, pos); in PreviousLinePos()
485 TerminalLine* line = _HistoryLineAt(pos.y, lineBuffer); in NextLinePos() local
486 if (line == NULL || pos.x < 0 || pos.x > fWidth) in NextLinePos()
489 if (!_NormalizeLinePos(lineBuffer, line, pos)) in NextLinePos()
492 pos.x += line->cells[pos.x].attributes.IsWidth() ? FULL_WIDTH : HALF_WIDTH; in NextLinePos()
493 return !normalize || _NormalizeLinePos(lineBuffer, line, pos); in NextLinePos()
501 TerminalLine* line = _HistoryLineAt(index, lineBuffer); in LineLength() local
502 return line != NULL ? line->length : 0; in LineLength()
510 TerminalLine* line = _HistoryLineAt(index, lineBuffer); in GetLineColor() local
511 if (line != NULL) in GetLineColor()
512 attr = line->attributes; in GetLineColor()
528 TerminalLine* line = _HistoryLineAt(pos.y, lineBuffer); in Find() local
529 if (line != NULL) { in Find()
531 while (line != NULL && pos.x >= line->length && line->softBreak) { in Find()
534 line = _HistoryLineAt(pos.y, lineBuffer); in Find()
537 if (pos.x > line->length) in Find()
538 pos.x = line->length; in Find()
645 TerminalLine* line = _LineAt(fCursor.y); in InsertChar() local
646 line->cells[fCursor.x].character = c; in InsertChar()
647 line->cells[fCursor.x].attributes = fAttributes; in InsertChar()
648 line->cells[fCursor.x].attributes.state |= (width == FULL_WIDTH ? A_WIDTH : 0); in InsertChar()
650 if (line->length < fCursor.x + width) in InsertChar()
651 line->length = fCursor.x + width; in InsertChar()
679 TerminalLine *line = _LineAt(y); in FillScreen() local
681 line->cells[x].character = c; in FillScreen()
682 line->cells[x].attributes = attributes; in FillScreen()
684 line->length = fWidth / width; in FillScreen()
694 TerminalLine* line = _LineAt(fCursor.y); in InsertCR() local
696 line->attributes = fAttributes; in InsertCR()
697 line->softBreak = false; in InsertCR()
753 TerminalLine* line = _LineAt(fCursor.y); in InsertTab() local
755 if (line->length <= i) { in InsertTab()
756 line->cells[i].character = ' '; in InsertTab()
757 line->cells[i].attributes = fAttributes; in InsertTab()
761 if (line->length < fCursor.x) in InsertTab()
762 line->length = fCursor.x; in InsertTab()
818 TerminalLine* line = _LineAt(fCursor.y); in InsertSpace() local
820 line->cells[i].character = kSpaceChar; in InsertSpace()
821 line->cells[i].attributes = line->cells[fCursor.x - 1].attributes; in InsertSpace()
823 line->attributes = fAttributes; in InsertSpace()
833 TerminalLine* line = _LineAt(fCursor.y); in EraseCharsFrom() local
837 line->cells[i].attributes = fAttributes; in EraseCharsFrom()
839 line->attributes = fAttributes; in EraseCharsFrom()
843 end = min_c(first + numChars, line->length); in EraseCharsFrom()
844 if (first > 0 && line->cells[first - 1].attributes.IsWidth()) in EraseCharsFrom()
846 if (end > 0 && line->cells[end - 1].attributes.IsWidth()) in EraseCharsFrom()
850 line->cells[i].character = kSpaceChar; in EraseCharsFrom()
851 line->cells[i].attributes = fAttributes; in EraseCharsFrom()
868 TerminalLine* line = _LineAt(fCursor.y); in EraseAbove() local
869 if (fCursor.x < line->length) { in EraseAbove()
871 if (line->cells[fCursor.x].attributes.IsWidth()) in EraseAbove()
874 line->cells[i].attributes = fAttributes; in EraseAbove()
875 line->cells[i].character = kSpaceChar; in EraseAbove()
878 line->Clear(fAttributes, fWidth); in EraseAbove()
925 TerminalLine* line = _LineAt(fCursor.y); in DeleteChars() local
926 if (fCursor.x < line->length) { in DeleteChars()
927 if (fCursor.x + numChars < line->length) { in DeleteChars()
928 int32 left = line->length - fCursor.x - numChars; in DeleteChars()
929 memmove(line->cells + fCursor.x, line->cells + fCursor.x + numChars, in DeleteChars()
931 line->length = fCursor.x + left; in DeleteChars()
934 line->cells[fCursor.x + left + i].attributes = fAttributes; in DeleteChars()
937 for (int i = 0; i < line->length - fCursor.x; i++) in DeleteChars()
938 line->cells[fCursor.x + i].attributes = fAttributes; in DeleteChars()
940 line->length = fCursor.x; in DeleteChars()
953 TerminalLine* line = _LineAt(fCursor.y); in DeleteColumnsFrom() local
956 line->cells[i].attributes = fAttributes; in DeleteColumnsFrom()
958 if (first <= line->length) { in DeleteColumnsFrom()
959 line->length = first; in DeleteColumnsFrom()
960 line->attributes = fAttributes; in DeleteColumnsFrom()
1136 TerminalLine* line = _LineAt(i); in _ClearLines() local
1137 if (line->length > 0) { in _ClearLines()
1143 line->Clear(fAttributes, fWidth); in _ClearLines()
1180 TerminalLine* line = fHistory->GetTerminalLineAt(i, lineBuffer); in _ResizeHistory() local
1181 if (line->length > width) in _ResizeHistory()
1182 _TruncateLine(line, width); in _ResizeHistory()
1183 history->AddLine(line); in _ResizeHistory()
1227 TerminalLine* line = _LineAt(i); in _ResizeSimple() local
1229 _TruncateLine(line, width); in _ResizeSimple()
1230 fHistory->AddLine(line); in _ResizeSimple()
1431 TerminalLine* line = screen[i % height]; in _ResizeRewrap() local
1433 history->AddLine(line); in _ResizeRewrap()
1434 line->Clear(fAttributes, width); in _ResizeRewrap()
1612 TerminalLine* line = _LineAt(fCursor.y); in _SoftBreakLine() local
1613 line->softBreak = true; in _SoftBreakLine()
1626 TerminalLine* line = _LineAt(fCursor.y); in _PadLineToCursor() local
1627 if (line->length < fCursor.x) in _PadLineToCursor()
1628 for (int32 i = line->length; i < fCursor.x; i++) in _PadLineToCursor()
1629 line->cells[i].character = kSpaceChar; in _PadLineToCursor()
1634 BasicTerminalBuffer::_TruncateLine(TerminalLine* line, int32 length) in _TruncateLine() argument
1636 if (line->length <= length) in _TruncateLine()
1639 if (length > 0 && line->cells[length - 1].attributes.IsWidth()) in _TruncateLine()
1642 line->length = length; in _TruncateLine()
1650 TerminalLine* line = _LineAt(fCursor.y); in _InsertGap() local
1652 int32 toMove = min_c(line->length - fCursor.x, fWidth - fCursor.x - width); in _InsertGap()
1654 memmove(line->cells + fCursor.x + width, in _InsertGap()
1655 line->cells + fCursor.x, toMove * sizeof(TerminalCell)); in _InsertGap()
1658 line->length = min_c(line->length + width, fWidth); in _InsertGap()
1669 TerminalLine* line = _HistoryLineAt(row, lineBuffer); in _GetPartialLineString() local
1670 if (line == NULL) in _GetPartialLineString()
1673 if (endColumn > line->length) in _GetPartialLineString()
1674 endColumn = line->length; in _GetPartialLineString()
1677 const TerminalCell& cell = line->cells[x]; in _GetPartialLineString()
1684 return line; in _GetPartialLineString()
1696 TerminalLine* line = _HistoryLineAt(pos.y, lineBuffer); in _PreviousChar() local
1701 line = _HistoryLineAt(pos.y, lineBuffer); in _PreviousChar()
1702 if (line == NULL) in _PreviousChar()
1705 pos.x = line->length; in _PreviousChar()
1706 if (line->softBreak) { in _PreviousChar()
1713 c = line->cells[pos.x].character; in _PreviousChar()
1726 TerminalLine* line = _HistoryLineAt(pos.y, lineBuffer); in _NextChar() local
1727 if (line == NULL) in _NextChar()
1730 if (pos.x >= line->length) { in _NextChar()
1737 c = line->cells[pos.x].character; in _NextChar()
1740 while (line != NULL && pos.x >= line->length && line->softBreak) { in _NextChar()
1743 line = _HistoryLineAt(pos.y, lineBuffer); in _NextChar()
1752 TerminalLine*& line, TermPos& pos) const in _PreviousLinePos() argument
1758 if ((line = _HistoryLineAt(pos.y, lineBuffer)) == NULL in _PreviousLinePos()
1759 || !line->softBreak || line->length == 0) { in _PreviousLinePos()
1762 pos.x = line->length - 1; in _PreviousLinePos()
1764 if (pos.x > 0 && line->cells[pos.x - 1].attributes.IsWidth()) in _PreviousLinePos()
1773 TerminalLine*& line, TermPos& pos) const in _NormalizeLinePos() argument
1775 if (pos.x < line->length) in _NormalizeLinePos()
1780 if (!line->softBreak) in _NormalizeLinePos()
1785 line = _HistoryLineAt(pos.y, lineBuffer); in _NormalizeLinePos()
1786 return line != NULL; in _NormalizeLinePos()
1814 TerminalLine* line = dumpHistory in MakeLinesSnapshots() local
1818 if (line == NULL) { in MakeLinesSnapshots()
1824 i, line->length, line->attributes.state); in MakeLinesSnapshots()
1825 for (int j = 0; j < line->length; j++) in MakeLinesSnapshots()
1826 if (line->cells[j].character.bytes[0] != 0) in MakeLinesSnapshots()
1827 fwrite(line->cells[j].character.bytes, 1, in MakeLinesSnapshots()
1828 line->cells[j].character.ByteCount(), fileOut); in MakeLinesSnapshots()
1834 (line->cells[j].attributes.state >> s) & 0x0F); in MakeLinesSnapshots()