Move eraseLine/eraseScreen to obsolete.

git-svn-id: svn://qnap.local/TwoTerm/trunk@2017 5590a31f-7b70-45f8-8c82-aa3a8e5f4507
This commit is contained in:
Kelvin Sherlock 2011-02-05 01:46:53 +00:00
parent d035f5e693
commit a6c9be6290
3 changed files with 57 additions and 37 deletions

View File

@ -577,38 +577,6 @@ void Screen::erase(TextPort* textPort, EraseRegion region)
}
void Screen::eraseLine()
{
// erases everything to the right of, and including, the cursor
for (CharInfoIterator ciIter = _screen[y()].begin() + x(); ciIter < _screen[y()].end(); ++ciIter)
{
*ciIter = CharInfo(0, _flag);
}
_updates.push_back(cursor());
_updates.push_back(iPoint(width() - 1, y()));
}
void Screen::eraseScreen()
{
// returns everything to the right of, and including, the cursor as well as all subsequent lines.
eraseLine();
if (y() == height() -1) return;
for (ScreenIterator iter = _screen.begin() + y(); iter < _screen.end(); ++iter)
{
for (CharInfoIterator ciIter = iter->begin(); ciIter < iter->end(); ++ciIter)
{
*ciIter = CharInfo(0, _flag);
}
}
_updates.push_back(iPoint(0, y() + 1));
_updates.push_back(iPoint(width() - 1, height() - 1));
}
void Screen::eraseRect(iRect rect)
@ -907,4 +875,10 @@ void Screen::setSize(unsigned w, unsigned h)
//fprintf(stderr, "setSize(%u, %u)\n", width, height);
}
}
void Screen::setCursorType(CursorType cursorType)
{
_cursorType = cursorType;
}

View File

@ -85,10 +85,10 @@ public:
};
enum CursorType {
CursorNone,
CursorUnderscore,
CursorPipe,
CursorBlock
CursorTypeNone,
CursorTypeUnderscore,
CursorTypePipe,
CursorTypeBlock
};
Screen(unsigned height = 24, unsigned width = 80);
@ -186,6 +186,10 @@ public:
virtual void setSize(unsigned width, unsigned height);
virtual void setCursorType(CursorType cursor);
CursorType cursorType() const;
private:
@ -195,6 +199,8 @@ private:
uint8_t _flag;
CursorType _cursorType;
Lock _lock;
@ -233,6 +239,11 @@ inline uint8_t Screen::flag() const
return _flag;
}
inline Screen::CursorType Screen::cursorType() const
{
return _cursorType;
}
inline int Screen::height() const
{
return _port.frame.size.height;

View File

@ -146,3 +146,38 @@ void Screen::insertc(uint8_t c)
iter->c = ' ';
}
void Screen::eraseLine()
{
// erases everything to the right of, and including, the cursor
for (CharInfoIterator ciIter = _screen[y()].begin() + x(); ciIter < _screen[y()].end(); ++ciIter)
{
*ciIter = CharInfo(0, _flag);
}
_updates.push_back(cursor());
_updates.push_back(iPoint(width() - 1, y()));
}
void Screen::eraseScreen()
{
// returns everything to the right of, and including, the cursor as well as all subsequent lines.
eraseLine();
if (y() == height() -1) return;
for (ScreenIterator iter = _screen.begin() + y(); iter < _screen.end(); ++iter)
{
for (CharInfoIterator ciIter = iter->begin(); ciIter < iter->end(); ++ciIter)
{
*ciIter = CharInfo(0, _flag);
}
}
_updates.push_back(iPoint(0, y() + 1));
_updates.push_back(iPoint(width() - 1, height() - 1));
}