Move event.* code into event_m[04].*.

Slightly more duplication of code now. Need a base class...
This commit is contained in:
Jared Boone 2016-01-12 22:00:42 -08:00
parent e73a9f98a1
commit 731cea1b96
11 changed files with 42 additions and 30 deletions

View file

@ -66,6 +66,7 @@ public:
painter(painter),
context(context)
{
thread_event_loop = chThdSelf();
touch_manager.on_event = [this](const ui::TouchEvent event) {
this->on_touch_event(event);
};
@ -86,7 +87,21 @@ public:
is_running = false;
}
static inline void events_flag(const eventmask_t events) {
if( thread_event_loop ) {
chEvtSignal(thread_event_loop, events);
}
}
static inline void events_flag_isr(const eventmask_t events) {
if( thread_event_loop ) {
chEvtSignalI(thread_event_loop, events);
}
}
private:
static Thread* thread_event_loop;
touch::Manager touch_manager;
ui::Widget* const top_widget;
ui::Painter& painter;