MCPcopy Create free account
hub / github.com/ConEmu/ConEmu / ExtScrollLine

Function ExtScrollLine

src/ConEmuHk/ExtConsole.cpp:1621–1737  ·  view source on GitHub ↗

From the cursor position!

Source from the content-addressed store, hash-verified

1619
1620// From the cursor position!
1621BOOL ExtScrollLine(ExtScrollScreenParm* Info)
1622{
1623 ORIGINALCALLCOUNT_(ExtScrollLine,-1);
1624
1625 int nDir = (int)Info->Dir;
1626 if (nDir == 0)
1627 {
1628 _ASSERTE(FALSE && "Nothing to do");
1629 return FALSE;
1630 }
1631
1632 HANDLE h = Info->ConsoleOutput;
1633 BOOL lbTrueColor = ExtCheckBuffers(h);
1634 UNREFERENCED_PARAMETER(lbTrueColor);
1635
1636 CONSOLE_SCREEN_BUFFER_INFO csbi = {};
1637 SMALL_RECT srWork = {};
1638 if (!ExtGetBufferInfo(h, csbi, srWork))
1639 return FALSE;
1640
1641
1642 SHORT nWindowWidth = srWork.Right - srWork.Left + 1;
1643 SHORT nWindowHeight = srWork.Bottom - srWork.Top + 1;
1644
1645 int nMaxCell = std::min(nWindowWidth * nWindowHeight, gpTrueColor->bufferSize);
1646 int nMaxRows = nMaxCell / nWindowWidth;
1647 int nY1 = (csbi.dwCursorPosition.Y - srWork.Top);
1648
1649 AnnotationInfo* pTrueColorStart = (AnnotationInfo*)(gpTrueColor ? (((LPBYTE)gpTrueColor) + gpTrueColor->struct_size) : NULL); //-V104
1650 AnnotationInfo* pTrueColorEnd = pTrueColorStart ? (pTrueColorStart + gpTrueColor->bufferSize) : NULL; //-V104
1651
1652 ORIGINAL_KRNL(ScrollConsoleScreenBufferW);
1653
1654 if (Info->Flags & essf_Current)
1655 {
1656 ExtAttributesParm DefClr = {sizeof(DefClr), h};
1657 ExtGetAttributes(&DefClr);
1658 Info->FillAttr = DefClr.Attributes;
1659 }
1660
1661 if (csbi.dwCursorPosition.X >= (csbi.dwSize.X-1))
1662 {
1663 _ASSERTE((csbi.dwCursorPosition.X >= (csbi.dwSize.X - 1)) && "Nothing to scroll?")
1664 }
1665 else if (_abs(nDir) >= (csbi.dwSize.X - csbi.dwCursorPosition.X))
1666 {
1667 COORD crf = csbi.dwCursorPosition;
1668 ExtFillOutputParm f0 = {sizeof(f0), efof_Attribute|efof_Character, h,
1669 Info->FillAttr, Info->FillChar, crf, (csbi.dwSize.X - csbi.dwCursorPosition.X)};
1670 ExtFillOutput(&f0);
1671
1672 }
1673 else
1674 {
1675 INT_PTR ccCellsTotal = (csbi.dwSize.X - csbi.dwCursorPosition.X);
1676 INT_PTR ccCellsMove = ccCellsTotal - _abs(nDir);
1677 INT_PTR ccCellsClear = _abs(nDir);
1678 COORD crf = csbi.dwCursorPosition;

Callers 1

ScrollLineMethod · 0.85

Calls 9

ExtCheckBuffersFunction · 0.85
ExtGetBufferInfoFunction · 0.85
ExtGetAttributesFunction · 0.85
_absFunction · 0.85
ExtFillOutputFunction · 0.85
ExtMoveColorDataFunction · 0.85
MakeCoordFunction · 0.85
ExtPrepareColorFunction · 0.85
DEBUGTESTFunction · 0.50

Tested by

no test coverage detected