From e201161fd46f3e9e83afd02a6eb854b0c85010a9 Mon Sep 17 00:00:00 2001
From: Ziusudra <ziusudra@gmail.com>
Date: Sun, 16 Dec 2012 16:35:34 -0700
Subject: [PATCH 9/9] Removed unused message and runner and related code
- kUpdateSigWinch was never sent, so it and fWinchRunner are not needed
- Without those _UpdateSIGWINCH was only called in one place, so it and
fFrameResized are no longer needed
---
src/apps/terminal/TermView.cpp | 29 +----------------------------
src/apps/terminal/TermView.h | 7 +------
2 files changed, 2 insertions(+), 34 deletions(-)
diff --git a/src/apps/terminal/TermView.cpp b/src/apps/terminal/TermView.cpp
index c71b160..b1621b5 100644
a
|
b
|
static property_info sPropList[] = {
|
361 | 361 | }; |
362 | 362 | |
363 | 363 | |
364 | | static const uint32 kUpdateSigWinch = 'Rwin'; |
365 | 364 | static const uint32 kBlinkCursor = 'BlCr'; |
366 | 365 | static const uint32 kAutoScroll = 'AScr'; |
367 | 366 | |
… |
… |
TermView::_InitObject(const ShellParameters& shellParameters)
|
545 | 544 | | B_FULL_UPDATE_ON_RESIZE/* | B_INPUT_METHOD_AWARE*/); |
546 | 545 | |
547 | 546 | fShell = NULL; |
548 | | fWinchRunner = NULL; |
549 | 547 | fCursorBlinkRunner = NULL; |
550 | 548 | fAutoScrollRunner = NULL; |
551 | 549 | fResizeRunner = NULL; |
… |
… |
TermView::_InitObject(const ShellParameters& shellParameters)
|
554 | 552 | fFontWidth = 0; |
555 | 553 | fFontHeight = 0; |
556 | 554 | fFontAscent = 0; |
557 | | fFrameResized = false; |
558 | 555 | fResizeViewDisableCount = 0; |
559 | 556 | fLastActivityTime = 0; |
560 | 557 | fCursorState = 0; |
… |
… |
TermView::SetTermSize(int rows, int columns)
|
847 | 844 | offset + rows + 2); |
848 | 845 | } |
849 | 846 | |
850 | | fFrameResized = true; |
851 | | _UpdateSIGWINCH(); |
| 847 | fShell->UpdateWindowSize(fRows, fColumns); |
852 | 848 | |
853 | 849 | return rect; |
854 | 850 | } |
… |
… |
TermView::_UpdateScrollBarRange()
|
1305 | 1301 | } |
1306 | 1302 | |
1307 | 1303 | |
1308 | | //! Handler for SIGWINCH |
1309 | | void |
1310 | | TermView::_UpdateSIGWINCH() |
1311 | | { |
1312 | | if (fFrameResized) { |
1313 | | fShell->UpdateWindowSize(fRows, fColumns); |
1314 | | fFrameResized = false; |
1315 | | } |
1316 | | } |
1317 | | |
1318 | | |
1319 | 1304 | void |
1320 | 1305 | TermView::AttachedToWindow() |
1321 | 1306 | { |
… |
… |
TermView::AttachedToWindow()
|
1333 | 1318 | |
1334 | 1319 | BMessenger thisMessenger(this); |
1335 | 1320 | |
1336 | | BMessage message(kUpdateSigWinch); |
1337 | | fWinchRunner = new (std::nothrow) BMessageRunner(thisMessenger, |
1338 | | &message, 500000); |
1339 | | |
1340 | 1321 | { |
1341 | 1322 | BAutolock _(fTextBuffer); |
1342 | 1323 | fTextBuffer->SetListener(thisMessenger); |
… |
… |
TermView::DetachedFromWindow()
|
1352 | 1333 | { |
1353 | 1334 | be_clipboard->StopWatching(BMessenger(this)); |
1354 | 1335 | |
1355 | | delete fWinchRunner; |
1356 | | fWinchRunner = NULL; |
1357 | | |
1358 | 1336 | delete fCursorBlinkRunner; |
1359 | 1337 | fCursorBlinkRunner = NULL; |
1360 | 1338 | |
… |
… |
TermView::FrameResized(float width, float height)
|
1746 | 1724 | fResizeViewDisableCount--; |
1747 | 1725 | |
1748 | 1726 | SetTermSize(rows, columns); |
1749 | | |
1750 | | fFrameResized = true; |
1751 | 1727 | } |
1752 | 1728 | |
1753 | 1729 | |
… |
… |
TermView::MessageReceived(BMessage *msg)
|
1987 | 1963 | case kBlinkCursor: |
1988 | 1964 | _BlinkCursor(); |
1989 | 1965 | break; |
1990 | | case kUpdateSigWinch: |
1991 | | _UpdateSIGWINCH(); |
1992 | | break; |
1993 | 1966 | case kAutoScroll: |
1994 | 1967 | _AutoScrollUpdate(); |
1995 | 1968 | break; |
diff --git a/src/apps/terminal/TermView.h b/src/apps/terminal/TermView.h
index 68272ee..2c7f749 100644
a
|
b
|
public:
|
59 | 59 | bool IsShellBusy() const; |
60 | 60 | bool GetActiveProcessInfo( |
61 | 61 | ActiveProcessInfo& _info) const; |
62 | | bool GetShellInfo(ShellInfo& _info) const; |
| 62 | bool GetShellInfo(ShellInfo& _info) const; |
63 | 63 | |
64 | 64 | const char* TerminalName() const; |
65 | 65 | |
… |
… |
private:
|
197 | 197 | bool _CheckSelectedRegion(int32 row, |
198 | 198 | int32 firstColumn, int32& lastColumn) const; |
199 | 199 | |
200 | | void _UpdateSIGWINCH(); |
201 | | |
202 | 200 | void _ScrollTo(float y, bool scrollGfx); |
203 | 201 | void _ScrollToRange(TermPos start, TermPos end); |
204 | 202 | |
… |
… |
private:
|
214 | 212 | Listener* fListener; |
215 | 213 | Shell* fShell; |
216 | 214 | |
217 | | BMessageRunner* fWinchRunner; |
218 | 215 | BMessageRunner* fCursorBlinkRunner; |
219 | 216 | BMessageRunner* fAutoScrollRunner; |
220 | 217 | BMessageRunner* fResizeRunner; |
… |
… |
private:
|
228 | 225 | int fFontAscent; |
229 | 226 | struct escapement_delta fEscapement; |
230 | 227 | |
231 | | // frame resized flag. |
232 | | bool fFrameResized; |
233 | 228 | int32 fResizeViewDisableCount; |
234 | 229 | |
235 | 230 | // Cursor Blinking, draw flag. |