diff options
Diffstat (limited to 'SwifTools/LastLineTracker.cpp')
-rw-r--r-- | SwifTools/LastLineTracker.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/SwifTools/LastLineTracker.cpp b/SwifTools/LastLineTracker.cpp new file mode 100644 index 0000000..a7360a8 --- /dev/null +++ b/SwifTools/LastLineTracker.cpp @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2011 Vlad Voicu + * Licensed under the Simplified BSD license. + * See Documentation/Licenses/BSD-simplified.txt for more information. + */ + +#include "LastLineTracker.h" + +using namespace Swift; + +LastLineTracker::LastLineTracker() { + lastFocus = true; + shouldMove = false; +} + +void LastLineTracker::setHasFocus(bool focus) { + if (!focus && lastFocus) { + shouldMove = true; + lastFocus = focus; + return; + } + shouldMove = false; + lastFocus = focus; +} + +bool LastLineTracker::getShouldMoveLastLine() { + bool ret = shouldMove; + shouldMove = false; + return ret; +} |