aboutsummaryrefslogtreecommitdiff
path: root/engines/pegasus/input.h
diff options
context:
space:
mode:
authorMatthew Hoops2011-09-08 23:04:28 -0400
committerMatthew Hoops2011-09-08 23:04:28 -0400
commite532af93180c53a80bd4a7e96ab42e7e67e13e97 (patch)
tree915c6a4ade337dc437e90e370249a5cc113150da /engines/pegasus/input.h
parent5a7ca3553ca480021c0992e83e9644eeeba2f724 (diff)
downloadscummvm-rg350-e532af93180c53a80bd4a7e96ab42e7e67e13e97.tar.gz
scummvm-rg350-e532af93180c53a80bd4a7e96ab42e7e67e13e97.tar.bz2
scummvm-rg350-e532af93180c53a80bd4a7e96ab42e7e67e13e97.zip
PEGASUS: Add and hookup the InputHandler class
Diffstat (limited to 'engines/pegasus/input.h')
-rwxr-xr-xengines/pegasus/input.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/engines/pegasus/input.h b/engines/pegasus/input.h
index 463e3d024b..432ff8098b 100755
--- a/engines/pegasus/input.h
+++ b/engines/pegasus/input.h
@@ -368,6 +368,52 @@ protected:
Common::Point _inputLocation;
};
+class InputHandler {
+public:
+ static InputHandler *setInputHandler(InputHandler*);
+ static InputHandler *getCurrentHandler() { return _inputHandler; }
+ static InputDevice *getCurrentInputDevice() { return &_inputDevice; }
+ static void pollForInput();
+ static void getInput(Input&, Hotspot*&);
+ static void readInputDevice(Input&);
+ static void invalHotspots() { _invalHotspots = true; }
+ static tInputBits getCurrentFilter() { return _lastFilter; }
+
+ InputHandler(InputHandler*);
+ virtual ~InputHandler();
+
+ virtual void setNextHandler(InputHandler *nextHandler) { _nextHandler = nextHandler; }
+ virtual InputHandler *getNextHandler() { return _nextHandler; }
+
+ virtual void handleInput(const Input&, const Hotspot*);
+ virtual void clickInHotspot(const Input&, const Hotspot*);
+
+ virtual void activateHotspots();
+ virtual void updateCursor(const Common::Point, const Hotspot*);
+ virtual bool isClickInput(const Input&, const Hotspot*);
+ virtual bool wantsCursor();
+
+ virtual bool releaseInputFocus() { return true; }
+ virtual void grabInputFocus() {}
+
+ // This returns bits set for what kinds of input to accept.
+ virtual tInputBits getInputFilter();
+
+ // This returns bits defining what input constitutes a "click."
+ virtual tInputBits getClickFilter();
+
+ virtual void allowInput(const bool allow) { _allowInput = allow; }
+
+protected:
+ static InputHandler *_inputHandler;
+ static InputDevice _inputDevice; // TODO: Remove global constructor
+ static bool _invalHotspots;
+ static tInputBits _lastFilter;
+
+ InputHandler *_nextHandler;
+ bool _allowInput;
+};
+
} // End of namespace Pegasus
#endif