Removed CURON/CUROFF constants. Use a boolean instead.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22042 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stefano Ceccherini 2007-08-22 20:29:40 +00:00
parent 3460c2c4eb
commit 40056ffaaf
3 changed files with 26 additions and 30 deletions

View File

@ -125,7 +125,7 @@ TermParse::GetReaderBuf(uchar &c)
fView->UpdateLine();
// Reset cursor blinking time and turn on cursor blinking.
fView->SetCurDraw(CURON);
fView->SetCurDraw(true);
// wait new input from pty.
do {
@ -146,7 +146,7 @@ TermParse::GetReaderBuf(uchar &c)
release_sem(fReaderLocker);
}
fView->SetCurDraw(CUROFF);
fView->SetCurDraw(false);
return B_OK;
}

View File

@ -144,10 +144,10 @@ TermView::TermView(BRect frame, int32 argc, const char **argv, int32 historySize
fScrollBarRange(0),
fFrameResized(false),
fLastCursorTime(0),
fCursorDrawFlag(CURON),
fCursorStatus(CURON),
fCursorBlinkingFlag(CURON),
fCursorRedrawFlag(CURON),
fCursorDrawFlag(true),
fCursorStatus(true),
fCursorBlinkingFlag(true),
fCursorRedrawFlag(true),
fCursorHeight(0),
fCurPos(0, 0),
fCurStack(0, 0),
@ -193,10 +193,10 @@ TermView::TermView(int rows, int columns, int32 argc, const char **argv, int32 h
fScrollBarRange(0),
fFrameResized(false),
fLastCursorTime(0),
fCursorDrawFlag(CURON),
fCursorStatus(CURON),
fCursorBlinkingFlag(CURON),
fCursorRedrawFlag(CURON),
fCursorDrawFlag(true),
fCursorStatus(true),
fCursorBlinkingFlag(true),
fCursorRedrawFlag(true),
fCursorHeight(0),
fCurPos(0, 0),
fCurStack(0, 0),
@ -243,10 +243,10 @@ TermView::TermView(BMessage *archive)
fScrollBarRange(0),
fFrameResized(false),
fLastCursorTime(0),
fCursorDrawFlag(CURON),
fCursorStatus(CURON),
fCursorBlinkingFlag(CURON),
fCursorRedrawFlag(CURON),
fCursorDrawFlag(true),
fCursorStatus(true),
fCursorBlinkingFlag(true),
fCursorRedrawFlag(true),
fCursorHeight(0),
fCurPos(0, 0),
fCurStack(0, 0),
@ -1006,15 +1006,15 @@ TermView::DrawCursor()
void
TermView::BlinkCursor()
{
if (fCursorDrawFlag == CURON
&& fCursorBlinkingFlag == CURON
if (fCursorDrawFlag
&& fCursorBlinkingFlag
&& Window()->IsActive()) {
if (fCursorStatus == CURON)
if (fCursorStatus)
_TermDraw(fCurPos, fCurPos);
else
DrawCursor();
fCursorStatus = fCursorStatus == CURON ? CUROFF : CURON;
fCursorStatus = !fCursorStatus;
fLastCursorTime = system_time();
}
}
@ -1024,16 +1024,16 @@ TermView::BlinkCursor()
void
TermView::SetCurDraw(bool flag)
{
if (flag == CUROFF) {
if (fCursorStatus == CURON)
if (!flag) {
if (fCursorStatus)
_TermDraw(fCurPos, fCurPos);
fCursorStatus = CUROFF;
fCursorDrawFlag = CUROFF;
fCursorStatus = false;
fCursorDrawFlag = false;
} else {
if (fCursorDrawFlag == CUROFF) {
fCursorDrawFlag = CURON;
fCursorStatus = CURON;
if (!fCursorDrawFlag) {
fCursorDrawFlag = true;
fCursorStatus = true;
if (LockLooper()) {
DrawCursor();
@ -1561,7 +1561,7 @@ TermView::Draw(BRect updateRect)
}
}
if (fCursorStatus == CURON)
if (fCursorStatus)
DrawCursor();
Window()->EndViewTransaction();

View File

@ -19,10 +19,6 @@
#include <String.h>
#include <View.h>
/* Cursor Blinking flag */
#define CUROFF 0
#define CURON 1
class BClipboard;
class BMessageRunner;