mirror of
https://github.com/ksherlock/TwoTerm.git
synced 2024-09-27 08:54:24 +00:00
Move eraseLine/eraseScreen to obsolete.
git-svn-id: svn://qnap.local/TwoTerm/trunk@2017 5590a31f-7b70-45f8-8c82-aa3a8e5f4507
This commit is contained in:
parent
d035f5e693
commit
a6c9be6290
@ -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)
|
||||
@ -908,3 +876,9 @@ void Screen::setSize(unsigned w, unsigned h)
|
||||
//fprintf(stderr, "setSize(%u, %u)\n", width, height);
|
||||
|
||||
}
|
||||
|
||||
|
||||
void Screen::setCursorType(CursorType cursorType)
|
||||
{
|
||||
_cursorType = cursorType;
|
||||
}
|
||||
|
19
cpp/Screen.h
19
cpp/Screen.h
@ -85,10 +85,10 @@ public:
|
||||
};
|
||||
|
||||
enum CursorType {
|
||||
CursorNone,
|
||||
CursorUnderscore,
|
||||
CursorPipe,
|
||||
CursorBlock
|
||||
CursorTypeNone,
|
||||
CursorTypeUnderscore,
|
||||
CursorTypePipe,
|
||||
CursorTypeBlock
|
||||
};
|
||||
|
||||
Screen(unsigned height = 24, unsigned width = 80);
|
||||
@ -187,6 +187,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;
|
||||
|
@ -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));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user