summaryrefslogtreecommitdiffstats
path: root/engine/focusable.cpp
blob: 1f82a2b499ae7f6fb33d5db1dd2907cf2759af72 (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
#include "serial/focusable.hpp"
#include "core/task.hpp"
#include "serial.hpp"

using namespace flat;

Focusable::Focusable(bool focused) : m_focused(focused) 
{
    // event_trigger = new flat::core::task<Focusable>(this, &Focusable::serial_precall, 0); 
}

Focusable::~Focusable()
{
    // delete event_trigger;
}

void Focusable::setFocused(bool flag)
{
    m_focused = flag;
}

bool Focusable::isFocused() const
{
    return m_focused;
}

void Focusable::serial_precall(void*)
{
    for (auto event : FlatSerial::collector->getStack(stackID()))
        serial_cb(&event);
}