summaryrefslogtreecommitdiffstats
path: root/engine/include/serial/focusable.hpp
blob: 008f7a3582f079f2f97fa8bdc2a68c9a1cee2e06 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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