Automatic whitespace cleanup, no functional change.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35292 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
7f2f2fa041
commit
96d719ae74
@ -232,14 +232,14 @@ TermView::TermView(BMessage* archive)
|
|||||||
fReportAnyMouseEvent(false)
|
fReportAnyMouseEvent(false)
|
||||||
{
|
{
|
||||||
BRect frame = Bounds();
|
BRect frame = Bounds();
|
||||||
|
|
||||||
if (archive->FindInt32("encoding", (int32*)&fEncoding) < B_OK)
|
if (archive->FindInt32("encoding", (int32*)&fEncoding) < B_OK)
|
||||||
fEncoding = M_UTF8;
|
fEncoding = M_UTF8;
|
||||||
if (archive->FindInt32("columns", (int32*)&fColumns) < B_OK)
|
if (archive->FindInt32("columns", (int32*)&fColumns) < B_OK)
|
||||||
fColumns = COLUMNS_DEFAULT;
|
fColumns = COLUMNS_DEFAULT;
|
||||||
if (archive->FindInt32("rows", (int32*)&fRows) < B_OK)
|
if (archive->FindInt32("rows", (int32*)&fRows) < B_OK)
|
||||||
fRows = ROWS_DEFAULT;
|
fRows = ROWS_DEFAULT;
|
||||||
|
|
||||||
int32 argc = 0;
|
int32 argc = 0;
|
||||||
if (archive->HasInt32("argc"))
|
if (archive->HasInt32("argc"))
|
||||||
archive->FindInt32("argc", &argc);
|
archive->FindInt32("argc", &argc);
|
||||||
@ -257,7 +257,7 @@ TermView::TermView(BMessage* archive)
|
|||||||
bool useRect = false;
|
bool useRect = false;
|
||||||
if ((archive->FindBool("use_rect", &useRect) == B_OK) && useRect)
|
if ((archive->FindBool("use_rect", &useRect) == B_OK) && useRect)
|
||||||
SetTermSize(frame);
|
SetTermSize(frame);
|
||||||
|
|
||||||
delete[] argv;
|
delete[] argv;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -342,7 +342,7 @@ TermView::_InitObject(int32 argc, const char** argv)
|
|||||||
return B_NO_MEMORY;
|
return B_NO_MEMORY;
|
||||||
|
|
||||||
SetTermFont(be_fixed_font);
|
SetTermFont(be_fixed_font);
|
||||||
|
|
||||||
error = fShell->Open(fRows, fColumns,
|
error = fShell->Open(fRows, fColumns,
|
||||||
EncodingAsShortString(fEncoding), argc, argv);
|
EncodingAsShortString(fEncoding), argc, argv);
|
||||||
|
|
||||||
@ -550,7 +550,7 @@ TermView::SetTermSize(BRect rect)
|
|||||||
{
|
{
|
||||||
int rows;
|
int rows;
|
||||||
int columns;
|
int columns;
|
||||||
|
|
||||||
GetTermSizeFromRect(rect, &rows, &columns);
|
GetTermSizeFromRect(rect, &rows, &columns);
|
||||||
SetTermSize(rows, columns);
|
SetTermSize(rows, columns);
|
||||||
}
|
}
|
||||||
@ -562,7 +562,7 @@ TermView::GetTermSizeFromRect(const BRect &rect, int *_rows,
|
|||||||
{
|
{
|
||||||
int columns = (rect.IntegerWidth() + 1) / fFontWidth;
|
int columns = (rect.IntegerWidth() + 1) / fFontWidth;
|
||||||
int rows = (rect.IntegerHeight() + 1) / fFontHeight;
|
int rows = (rect.IntegerHeight() + 1) / fFontHeight;
|
||||||
|
|
||||||
if (_rows)
|
if (_rows)
|
||||||
*_rows = rows;
|
*_rows = rows;
|
||||||
if (_columns)
|
if (_columns)
|
||||||
@ -621,8 +621,8 @@ TermView::SetMouseClipboard(BClipboard *clipboard)
|
|||||||
{
|
{
|
||||||
fMouseClipboard = clipboard;
|
fMouseClipboard = clipboard;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
TermView::GetTermFont(BFont *font) const
|
TermView::GetTermFont(BFont *font) const
|
||||||
{
|
{
|
||||||
@ -796,7 +796,7 @@ TermView::_AttachShell(Shell *shell)
|
|||||||
return B_BAD_VALUE;
|
return B_BAD_VALUE;
|
||||||
|
|
||||||
fShell = shell;
|
fShell = shell;
|
||||||
|
|
||||||
return fShell->AttachBuffer(TextBuffer());
|
return fShell->AttachBuffer(TextBuffer());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -813,7 +813,7 @@ void
|
|||||||
TermView::_Activate()
|
TermView::_Activate()
|
||||||
{
|
{
|
||||||
fActive = true;
|
fActive = true;
|
||||||
|
|
||||||
if (fCursorBlinkRunner == NULL) {
|
if (fCursorBlinkRunner == NULL) {
|
||||||
BMessage blinkMessage(kBlinkCursor);
|
BMessage blinkMessage(kBlinkCursor);
|
||||||
fCursorBlinkRunner = new (std::nothrow) BMessageRunner(
|
fCursorBlinkRunner = new (std::nothrow) BMessageRunner(
|
||||||
@ -830,7 +830,7 @@ TermView::_Deactivate()
|
|||||||
_InvalidateTextRect(fCursor.x, fCursor.y, fCursor.x, fCursor.y);
|
_InvalidateTextRect(fCursor.x, fCursor.y, fCursor.x, fCursor.y);
|
||||||
delete fCursorBlinkRunner;
|
delete fCursorBlinkRunner;
|
||||||
fCursorBlinkRunner = NULL;
|
fCursorBlinkRunner = NULL;
|
||||||
|
|
||||||
fActive = false;
|
fActive = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -956,7 +956,7 @@ void
|
|||||||
TermView::_BlinkCursor()
|
TermView::_BlinkCursor()
|
||||||
{
|
{
|
||||||
bool wasVisible = _IsCursorVisible();
|
bool wasVisible = _IsCursorVisible();
|
||||||
|
|
||||||
if (!wasVisible && fInline && fInline->IsActive())
|
if (!wasVisible && fInline && fInline->IsActive())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -1022,7 +1022,7 @@ void
|
|||||||
TermView::AttachedToWindow()
|
TermView::AttachedToWindow()
|
||||||
{
|
{
|
||||||
fMouseButtons = 0;
|
fMouseButtons = 0;
|
||||||
|
|
||||||
MakeFocus(true);
|
MakeFocus(true);
|
||||||
if (fScrollBar) {
|
if (fScrollBar) {
|
||||||
fScrollBar->SetSteps(fFontHeight, fFontHeight * fRows);
|
fScrollBar->SetSteps(fFontHeight, fFontHeight * fRows);
|
||||||
@ -1144,7 +1144,7 @@ TermView::Draw(BRect updateRect)
|
|||||||
|
|
||||||
if (fInline && fInline->IsActive())
|
if (fInline && fInline->IsActive())
|
||||||
_DrawInlineMethodString();
|
_DrawInlineMethodString();
|
||||||
|
|
||||||
if (fCursor >= TermPos(x1, y1) && fCursor <= TermPos(x2, y2))
|
if (fCursor >= TermPos(x1, y1) && fCursor <= TermPos(x2, y2))
|
||||||
_DrawCursor();
|
_DrawCursor();
|
||||||
}
|
}
|
||||||
@ -1574,7 +1574,7 @@ TermView::MessageReceived(BMessage *msg)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case B_INPUT_METHOD_EVENT:
|
case B_INPUT_METHOD_EVENT:
|
||||||
{
|
{
|
||||||
int32 opcode;
|
int32 opcode;
|
||||||
@ -1707,8 +1707,8 @@ TermView::ScrollTo(BPoint where)
|
|||||||
//debug_printf("TermView::ScrollTo(): %f -> %f\n", fScrollOffset, where.y);
|
//debug_printf("TermView::ScrollTo(): %f -> %f\n", fScrollOffset, where.y);
|
||||||
float diff = where.y - fScrollOffset;
|
float diff = where.y - fScrollOffset;
|
||||||
if (diff == 0)
|
if (diff == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
float bottom = Bounds().bottom;
|
float bottom = Bounds().bottom;
|
||||||
int32 oldFirstLine = _LineAt(0);
|
int32 oldFirstLine = _LineAt(0);
|
||||||
int32 oldLastLine = _LineAt(bottom);
|
int32 oldLastLine = _LineAt(bottom);
|
||||||
@ -1748,7 +1748,7 @@ void
|
|||||||
TermView::TargetedByScrollView(BScrollView *scrollView)
|
TermView::TargetedByScrollView(BScrollView *scrollView)
|
||||||
{
|
{
|
||||||
BView::TargetedByScrollView(scrollView);
|
BView::TargetedByScrollView(scrollView);
|
||||||
|
|
||||||
SetScrollBar(scrollView ? scrollView->ScrollBar(B_VERTICAL) : NULL);
|
SetScrollBar(scrollView ? scrollView->ScrollBar(B_VERTICAL) : NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2815,26 +2815,26 @@ TermView::_DrawInlineMethodString()
|
|||||||
{
|
{
|
||||||
if (!fInline || !fInline->String())
|
if (!fInline || !fInline->String())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const int32 numChars = BString(fInline->String()).CountChars();
|
const int32 numChars = BString(fInline->String()).CountChars();
|
||||||
|
|
||||||
BPoint startPoint = _ConvertFromTerminal(fCursor);
|
BPoint startPoint = _ConvertFromTerminal(fCursor);
|
||||||
BPoint endPoint = startPoint;
|
BPoint endPoint = startPoint;
|
||||||
endPoint.x += fFontWidth * numChars;
|
endPoint.x += fFontWidth * numChars;
|
||||||
endPoint.y += fFontHeight + 1;
|
endPoint.y += fFontHeight + 1;
|
||||||
|
|
||||||
BRect eraseRect(startPoint, endPoint);
|
BRect eraseRect(startPoint, endPoint);
|
||||||
|
|
||||||
PushState();
|
PushState();
|
||||||
SetHighColor(kTermColorTable[7]);
|
SetHighColor(kTermColorTable[7]);
|
||||||
FillRect(eraseRect);
|
FillRect(eraseRect);
|
||||||
PopState();
|
PopState();
|
||||||
|
|
||||||
BPoint loc = _ConvertFromTerminal(fCursor);
|
BPoint loc = _ConvertFromTerminal(fCursor);
|
||||||
loc.y += fFontHeight;
|
loc.y += fFontHeight;
|
||||||
SetFont(&fHalfFont);
|
SetFont(&fHalfFont);
|
||||||
SetHighColor(kTermColorTable[0]);
|
SetHighColor(kTermColorTable[0]);
|
||||||
SetLowColor(kTermColorTable[7]);
|
SetLowColor(kTermColorTable[7]);
|
||||||
DrawString(fInline->String(), loc);
|
DrawString(fInline->String(), loc);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2849,7 +2849,7 @@ TermView::_HandleInputMethodChanged(BMessage *message)
|
|||||||
_ActivateCursor(false);
|
_ActivateCursor(false);
|
||||||
|
|
||||||
if (IsFocus())
|
if (IsFocus())
|
||||||
be_app->ObscureCursor();
|
be_app->ObscureCursor();
|
||||||
|
|
||||||
// If we find the "be:confirmed" boolean (and the boolean is true),
|
// If we find the "be:confirmed" boolean (and the boolean is true),
|
||||||
// it means it's over for now, so the current InlineInput object
|
// it means it's over for now, so the current InlineInput object
|
||||||
@ -2858,13 +2858,13 @@ TermView::_HandleInputMethodChanged(BMessage *message)
|
|||||||
bool confirmed;
|
bool confirmed;
|
||||||
if (message->FindBool("be:confirmed", &confirmed) != B_OK)
|
if (message->FindBool("be:confirmed", &confirmed) != B_OK)
|
||||||
confirmed = false;
|
confirmed = false;
|
||||||
|
|
||||||
fInline->SetString("");
|
fInline->SetString("");
|
||||||
|
|
||||||
Invalidate();
|
Invalidate();
|
||||||
// TODO: Debug only
|
// TODO: Debug only
|
||||||
snooze(100000);
|
snooze(100000);
|
||||||
|
|
||||||
fInline->SetString(string);
|
fInline->SetString(string);
|
||||||
fInline->ResetClauses();
|
fInline->ResetClauses();
|
||||||
|
|
||||||
@ -2939,10 +2939,10 @@ TermView::_HandleInputMethodLocationRequest()
|
|||||||
const int32 &limit = string.CountChars();
|
const int32 &limit = string.CountChars();
|
||||||
BPoint where = _ConvertFromTerminal(fCursor);
|
BPoint where = _ConvertFromTerminal(fCursor);
|
||||||
where.y += fFontHeight;
|
where.y += fFontHeight;
|
||||||
|
|
||||||
for (int32 i = 0; i < limit; i++) {
|
for (int32 i = 0; i < limit; i++) {
|
||||||
// Add the location of the UTF8 characters
|
// Add the location of the UTF8 characters
|
||||||
|
|
||||||
where.x += fFontWidth;
|
where.x += fFontWidth;
|
||||||
ConvertToScreen(&where);
|
ConvertToScreen(&where);
|
||||||
|
|
||||||
@ -2966,7 +2966,7 @@ TermView::_CancelInputMethod()
|
|||||||
|
|
||||||
if (inlineInput->IsActive() && Window()) {
|
if (inlineInput->IsActive() && Window()) {
|
||||||
Invalidate();
|
Invalidate();
|
||||||
|
|
||||||
BMessage message(B_INPUT_METHOD_EVENT);
|
BMessage message(B_INPUT_METHOD_EVENT);
|
||||||
message.AddInt32("be:opcode", B_INPUT_METHOD_STOPPED);
|
message.AddInt32("be:opcode", B_INPUT_METHOD_STOPPED);
|
||||||
inlineInput->Method()->SendMessage(&message);
|
inlineInput->Method()->SendMessage(&message);
|
||||||
|
Loading…
Reference in New Issue
Block a user