summaryrefslogtreecommitdiffstats
path: root/engine/include/serial/focusable.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'engine/include/serial/focusable.hpp')
-rw-r--r--engine/include/serial/focusable.hpp37
1 files changed, 37 insertions, 0 deletions
diff --git a/engine/include/serial/focusable.hpp b/engine/include/serial/focusable.hpp
new file mode 100644
index 0000000..008f7a3
--- /dev/null
+++ b/engine/include/serial/focusable.hpp
@@ -0,0 +1,37 @@
+#ifndef __FOCUSABLE_H__
+#define __FOCUSABLE_H__
+
+#include "core/object.hpp"
+#include "types.hpp"
+
+class task_s;
+union SDL_Event;
+
+class Focusable : virtual public flat::core::object
+{
+ bool focused;
+
+ task_s * event_trigger;
+
+protected:
+
+ /* Callback to event */
+ virtual void serial_cb(const SDL_Event*) = 0;
+
+ /* Event stack specification */
+ virtual uint32_t stackID() const = 0;
+
+public:
+
+ Focusable(bool focused = true);
+
+ virtual ~Focusable();
+
+ void setFocused(bool flag);
+
+ bool isFocused() const;
+
+ void serial_precall(void*);
+};
+
+#endif