Files
Upsilon/apps/apps_container.cpp
Romain Goyet 7789123913 [Escher] Add a Container that lets us run multiple apps
Change-Id: I674348ed0ff48934eb248dc48735f4ba13c34692
2016-08-12 15:15:28 +02:00

35 lines
616 B
C++

#include "apps_container.h"
AppsContainer::AppsContainer() :
Container()
{
}
bool AppsContainer::handleEvent(ion_event_t event) {
if (event == F1) {
#if USE_PIC_VIEW_APP
if (activeApp() == &m_picViewApp) {
Container::switchTo(&m_graphApp);
} else {
Container::switchTo(&m_picViewApp);
}
#endif
return true;
}
return false;
}
void AppsContainer::switchTo(AppId appId) {
Container::switchTo(appWithId(appId));
}
App * AppsContainer::appWithId(AppId appId) {
App * apps[] = {
&m_graphApp
#if USE_PIC_VIEW_APP
, &m_picViewApp
#endif
};
return apps[(int)appId];
};