From f695b5b4791889229d6db12f917115417a83e28c Mon Sep 17 00:00:00 2001 From: curt Date: Fri, 1 Jun 2001 17:51:09 +0000 Subject: [PATCH] - refactored and simplified FGBinding class to use the new command manager; removed unused getters and setters; track original command name for use in debugging messages - removed unused action methods from FGInput --- src/Input/input.hxx | 64 +++++---------------------------------------- 1 file changed, 7 insertions(+), 57 deletions(-) diff --git a/src/Input/input.hxx b/src/Input/input.hxx index 46d8c6c2c..8358412da 100644 --- a/src/Input/input.hxx +++ b/src/Input/input.hxx @@ -30,6 +30,7 @@ #include +#include #include #include
@@ -52,28 +53,14 @@ class FGBinding { public: - enum Action { - ACTION_NONE, - ACTION_SWITCH, - ACTION_ADJUST, - ACTION_ASSIGN - }; - FGBinding (); FGBinding (const SGPropertyNode * node); virtual ~FGBinding (); - virtual Action getAction () const { return _action; } - virtual SGPropertyNode * getProperty () { return _node; } - virtual const SGPropertyNode * getProperty () const { return _node; } - virtual const SGValue * getAdjustStep () const { return _adjust_step; } - virtual const SGValue * getAssignValue () const { return _assign_value; } + virtual const string &getCommandName () const { return _command_name; } + virtual SGCommandMgr::command_t getCommand () const { return _command; } + virtual const SGPropertyNode * getArg () { return _arg; } - virtual void setAction (Action action); - virtual void setProperty (SGPropertyNode * node); - virtual void setAdjustStep (const SGValue * step); - virtual void setAssignValue (const SGValue * value); - virtual void read (const SGPropertyNode * node); virtual void fire () const; @@ -81,10 +68,9 @@ public: // virtual void fire (int xdelta, int ydelta); private: - Action _action; - SGPropertyNode * _node; - const SGValue * _adjust_step; - const SGValue * _assign_value; + string _command_name; + SGCommandMgr::command_t _command; + const SGPropertyNode * _arg; }; @@ -136,42 +122,6 @@ public: virtual void doKey (int k, int modifiers, int x, int y); - /** - * Fire off a single-trigger action. - * - *

This method fires an action triggered by a key or button - * press, with no additional quantity information.

- * - * @param binding The property node with the binding. - */ - virtual void action (const SGPropertyNode * binding); - - - /** - * Fire off a quantity action. - * - *

This method fires an action triggered by a change in value, - * such as a slider or axis.

- * - * @param action The property node with the binding. - * @param value The new value. - */ -// virtual void action (const SGPropertyNode * binding, double value); - - - /** - * Fire off a movement action. - * - *

This method fires an action triggered by relative movement - * rather than an absolute value; it is especially applicable to - * mouse-movement bindings.

- * - * @param binding The property node containing the binding. - * @param xdelta The amount of X movement. - * @param ydelta The amount of Y movement. - */ -// virtual void action (const SGPropertyNode * binding, int xdelta, int ydelta); - private: /** -- 2.39.5