mirror of
https://github.com/mudita/MuditaOS.git
synced 2026-07-30 01:38:48 -04:00
Split module-utils into smaller components for better dependency management. Fix many dependencies throughout the project. Signed-off-by: Marcin Smoczyński <smoczynski.marcin@gmail.com>
41 lines
1.3 KiB
C++
41 lines
1.3 KiB
C++
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
|
|
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
|
|
|
|
#include <endpoints/developerMode/Mode/UI_Helper.hpp>
|
|
#include <log/log.hpp>
|
|
#include "service-desktop/Constants.hpp"
|
|
#include "service-desktop/DeveloperModeMessage.hpp"
|
|
#include <service-appmgr/Constants.hpp>
|
|
#include <service-appmgr/messages/DOMRequest.hpp>
|
|
|
|
namespace sdesktop::endpoints
|
|
{
|
|
void UI_Helper::preProcess(http::Method method, Context &context)
|
|
{
|
|
LOG_INFO("In UI helper - requesting %d", static_cast<int>(method));
|
|
}
|
|
|
|
class UIEvent : public sdesktop::Event
|
|
{
|
|
public:
|
|
UIEvent(Context &ctx)
|
|
{
|
|
context = ctx;
|
|
}
|
|
};
|
|
|
|
auto UI_Helper::processGet(Context &context) -> ProcessResult
|
|
{
|
|
const auto &body = context.getBody();
|
|
if (body["getWindow"] == true) {
|
|
auto event = UIEvent(context);
|
|
owner->bus.sendUnicast(
|
|
std::make_shared<app::manager::DOMRequest>(service::name::service_desktop,
|
|
std::make_unique<sdesktop::Event>(std::move(event))),
|
|
service::name::appmgr);
|
|
return {sent::delayed, std::nullopt};
|
|
}
|
|
return {sent::no, std::nullopt};
|
|
}
|
|
}; // namespace sdesktop::endpoints
|