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

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

union SDL_Event;

namespace flat {

class Focusable : virtual public flat::object
{
    bool 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