Files
MuditaOS/module-apps/WindowsFactory.cpp
Adam Dobrowolski 7b4a706cd6 EGD-4036 Application windows - added register mechanism
* Moved ApplicationLauncher to separate files - declutering
* WindowsStore renamed to WindowsFactory - Store needs to be splitted toavoid antipattern
* Options window build dynamically onBeforeShow
* Dialog windows dynamically built
2020-10-13 17:46:10 +02:00

22 lines
499 B
C++

#include "WindowsFactory.hpp"
#include <AppWindow.hpp>
namespace app
{
void WindowsFactory::attach(const std::string &name, builder builder)
{
builders[name] = builder;
}
auto WindowsFactory::isRegistered(const std::string &name) const -> bool
{
return builders.find(name) != std::end(builders);
}
auto WindowsFactory::build(Application *app, const std::string &name) -> handle
{
return builders[name](app, name);
}
} // namespace app