diff options
author | Matthew Hoops | 2011-09-18 15:48:31 -0400 |
---|---|---|
committer | Matthew Hoops | 2011-09-18 15:48:31 -0400 |
commit | 8f6e6030999e7263062461eaf6e0fe378a3892ba (patch) | |
tree | c057fd4ad7f7b1e027c0548bdd12a17b5a368949 /engines/pegasus/input.h | |
parent | 1390db1df12a8a853deca62df2e11a899c111fcf (diff) | |
download | scummvm-rg350-8f6e6030999e7263062461eaf6e0fe378a3892ba.tar.gz scummvm-rg350-8f6e6030999e7263062461eaf6e0fe378a3892ba.tar.bz2 scummvm-rg350-8f6e6030999e7263062461eaf6e0fe378a3892ba.zip |
PEGASUS: Add the Tracker class
Diffstat (limited to 'engines/pegasus/input.h')
-rwxr-xr-x | engines/pegasus/input.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/engines/pegasus/input.h b/engines/pegasus/input.h index 432ff8098b..4da0418a53 100755 --- a/engines/pegasus/input.h +++ b/engines/pegasus/input.h @@ -414,6 +414,41 @@ protected: bool _allowInput; }; + +/* + + Tracker implements "dragging". A Tracker can receive a startTracking message, + which causes it to be the current tracker, as well as setting it up as the current + input handler. In addition, only one tracker can be tracking at a time, and no + other handler can be set up as the current handler until the track finishes. By + default, there is no next input handler for a Tracker, but this behavior can be + overridden if desired. + +*/ + +class Tracker : public InputHandler { +public: + Tracker() : InputHandler(0) {} + virtual ~Tracker(); + + virtual void handleInput(const Input &, const Hotspot *); + virtual bool stopTrackingInput(const Input &) { return false; } + + virtual void startTracking(const Input &); + virtual void stopTracking(const Input &); + virtual void continueTracking(const Input &) {} + + bool isTracking() { return this == _currentTracker; } + bool isClickInput(const Input &, const Hotspot *); + + bool releaseInputFocus() { return !isTracking(); } + +protected: + static Tracker *_currentTracker; + + InputHandler *_savedHandler; +}; + } // End of namespace Pegasus #endif |