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

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

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

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

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

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