summaryrefslogtreecommitdiffstats
path: root/engine/include/serial/focusable.hpp
blob: e5f5d5be941552965c330f67d245acb4f7150cad (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
38
39
#ifndef __FOCUSABLE_H__
#define __FOCUSABLE_H__

#include "object.hpp"
#include "types.hpp"

union SDL_Event;

namespace flat {

class Focusable : virtual public flat::object
{
private:
    bool m_focused;

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