mirror of
https://github.com/mudita/MuditaOS.git
synced 2026-06-14 03:25:25 -04:00
36 lines
1.2 KiB
C++
36 lines
1.2 KiB
C++
#include "AppSpecialInput.hpp"
|
|
#include "messages/AppMessage.hpp"
|
|
#include "windows/InputSelector.hpp"
|
|
|
|
using namespace app;
|
|
|
|
AppSpecialInput::AppSpecialInput(std::string name, std::string parent, bool startBackgound) : Application(name, parent, startBackgound)
|
|
{
|
|
auto window = new gui::UiCharSelector(this);
|
|
windows.insert(std::pair<std::string, gui::AppWindow *>(window->getName(), window));
|
|
setActiveWindow(window->getName());
|
|
}
|
|
|
|
sys::Message_t AppSpecialInput::DataReceivedHandler(sys::DataMessage *msgl, sys::ResponseMessage *resp)
|
|
{
|
|
auto retMsg = Application::DataReceivedHandler(msgl);
|
|
if (reinterpret_cast<sys::ResponseMessage *>(retMsg.get())->retCode == sys::ReturnCodes::Success)
|
|
{
|
|
return retMsg;
|
|
}
|
|
|
|
return std::make_shared<sys::ResponseMessage>(sys::ReturnCodes::Unresolved);
|
|
}
|
|
|
|
// THIS IS IMPORTANT THIS SETS APPLICATION STATE... (not for example Application(...) constructor - this wouild be too easy
|
|
sys::ReturnCodes AppSpecialInput::InitHandler()
|
|
{
|
|
auto ret = Application::InitHandler();
|
|
if (ret != sys::ReturnCodes::Success)
|
|
{
|
|
LOG_ERROR("");
|
|
}
|
|
setActiveWindow("MainWindow");
|
|
return ret;
|
|
}
|