Changeset 25456
- Timestamp:
- 05/11/08 13:23:12 (6 days ago)
- Files:
-
- haiku/trunk/src/apps/terminal/TermView.cpp (modified) (9 diffs)
- haiku/trunk/src/apps/terminal/TermView.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
haiku/trunk/src/apps/terminal/TermView.cpp
r25411 r25456 85 85 86 86 const static uint32 kUpdateSigWinch = 'Rwin'; 87 const static uint32 kBlinkCursor = 'BlCr'; 87 88 88 89 const static rgb_color kBlackColor = { 0, 0, 0, 255 }; … … 90 91 91 92 92 93 93 TermView::TermView(BRect frame, int32 argc, const char **argv, int32 historySize) 94 94 : BView(frame, "termview", B_FOLLOW_ALL, 95 B_WILL_DRAW | B_FRAME_EVENTS | B_FULL_UPDATE_ON_RESIZE | B_PULSE_NEEDED),95 B_WILL_DRAW | B_FRAME_EVENTS | B_FULL_UPDATE_ON_RESIZE | B_PULSE_NEEDED), 96 96 fShell(NULL), 97 97 fWinchRunner(NULL), 98 fCursorBlinkRunner(NULL), 98 99 fFontWidth(0), 99 100 fFontHeight(0), … … 141 142 TermView::TermView(int rows, int columns, int32 argc, const char **argv, int32 historySize) 142 143 : BView(BRect(0, 0, 0, 0), "termview", B_FOLLOW_ALL, 143 B_WILL_DRAW | B_FRAME_EVENTS | B_FULL_UPDATE_ON_RESIZE | B_PULSE_NEEDED),144 B_WILL_DRAW | B_FRAME_EVENTS | B_FULL_UPDATE_ON_RESIZE | B_PULSE_NEEDED), 144 145 fShell(NULL), 145 146 fWinchRunner(NULL), 147 fCursorBlinkRunner(NULL), 146 148 fFontWidth(0), 147 149 fFontHeight(0), … … 186 188 SetTermSize(fTermRows, fTermColumns, true); 187 189 190 // TODO: Don't show the dragger, since replicant capabilities 191 // don't work very well ATM. 192 /* 188 193 BRect rect(0, 0, 16, 16); 189 194 rect.OffsetTo(Bounds().right - rect.Width(), … … 192 197 SetFlags(Flags() | B_DRAW_ON_CHILDREN | B_FOLLOW_ALL); 193 198 AddChild(new BDragger(rect, this, 194 B_FOLLOW_RIGHT|B_FOLLOW_BOTTOM, B_WILL_DRAW)); 199 B_FOLLOW_RIGHT|B_FOLLOW_BOTTOM, B_WILL_DRAW));*/ 195 200 } 196 201 … … 201 206 fShell(NULL), 202 207 fWinchRunner(NULL), 208 fCursorBlinkRunner(NULL), 203 209 fFontWidth(0), 204 210 fFontHeight(0), … … 1312 1318 fScrollBar->SetSteps(fFontHeight, fFontHeight * fTermRows); 1313 1319 1320 BMessenger thisMessenger(this); 1314 1321 BMessage message(kUpdateSigWinch); 1315 fWinchRunner = new (std::nothrow) BMessageRunner(BMessenger(this), &message, 500000); 1316 1317 // TODO: Since we can also be a replicant, messing 1318 // with the window, which is not ours, is not nice: 1319 // Switch to using a BMessageRunner for the 1320 // blinking caret too. 1321 Window()->SetPulseRate(1000000); 1322 fWinchRunner = 1323 new (std::nothrow) BMessageRunner(thisMessenger, 1324 &message, 500000); 1325 1326 BMessage blinkMessage(kBlinkCursor); 1327 fCursorBlinkRunner = 1328 new (std::nothrow) BMessageRunner(thisMessenger, 1329 &blinkMessage, 1000000); 1322 1330 } 1323 1331 … … 1328 1336 delete fWinchRunner; 1329 1337 fWinchRunner = NULL; 1330 } 1331 1332 1333 void 1334 TermView::Pulse() 1335 { 1336 //if (system_time() > fLastCursorTime + 1000000) 1337 BlinkCursor(); 1338 1339 delete fCursorBlinkRunner; 1340 fCursorBlinkRunner = NULL; 1338 1341 } 1339 1342 … … 1763 1766 // } 1764 1767 // } 1768 case kBlinkCursor: 1769 _BlinkCursor(); 1770 break; 1765 1771 case kUpdateSigWinch: 1766 1772 _UpdateSIGWINCH(); haiku/trunk/src/apps/terminal/TermView.h
r23913 r25456 124 124 virtual void AttachedToWindow(); 125 125 virtual void DetachedFromWindow(); 126 virtual void Pulse();127 126 virtual void Draw(BRect updateRect); 128 127 virtual void WindowActivated(bool active); … … 195 194 196 195 BMessageRunner *fWinchRunner; 196 BMessageRunner *fCursorBlinkRunner; 197 197 198 198 // Font and Width
