[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Usata-commits] Changes to usata2/src/input-system.hpp
From: |
David Lau |
Subject: |
[Usata-commits] Changes to usata2/src/input-system.hpp |
Date: |
Tue, 25 Jan 2005 14:26:36 -0500 |
Index: usata2/src/input-system.hpp
diff -u usata2/src/input-system.hpp:1.2 usata2/src/input-system.hpp:1.3
--- usata2/src/input-system.hpp:1.2 Tue Jan 25 08:28:27 2005
+++ usata2/src/input-system.hpp Tue Jan 25 19:26:33 2005
@@ -10,16 +10,19 @@
// included in the software distribution, or visit
// http://www.fsf.org/licenses/gpl.html.
//
-// $Id: input-system.hpp,v 1.2 2005/01/25 08:28:27 skunix Exp $
+// $Id: input-system.hpp,v 1.3 2005/01/25 19:26:33 skunix Exp $
#ifndef USATA_INPUT_SYSTEM_HPP
#define USATA_INPUT_SYSTEM_HPP
#include <string>
#include <memory>
+#include <vector>
+
#include <boost/shared_ptr.hpp>
#include <boost/signal.hpp>
-#include <vector>
+#include <boost/function.hpp>
+
namespace usata
{
namespace input
@@ -37,6 +40,7 @@
ENTER,
SPACE,
ESCAPE,
+ UNKNOWN,
LAST
};
};
@@ -59,7 +63,6 @@
{
int mKey;
bool mState;
- char mValue;
public:
KeyEvent(unsigned Key, bool state);
unsigned key(){ return mKey; }
@@ -116,21 +119,31 @@
class Manager
{
typedef std::vector<Driver_sp> DriversV;
+
DriversV mDrivers;
+
public:
+
+ typedef boost::function<void(Event*)>
EventHandler;
+ typedef std::vector<EventHandler>
EventHandlerStack;
+
boost::signal<void ()> quit_signal;
Manager();
+
+ int push_handler(const EventHandler&);
+ int pop_handler();
+
void trim(void);
void add_driver(Driver*);
void process();
~Manager();
+ private:
+ EventHandlerStack mEvhStack;
};
Driver * default_driver();
}
-
-
}
#endif