// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved. // For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md #include #include #include "service-desktop/ServiceDesktopName.hpp" #include "service-desktop/DeveloperModeMessage.hpp" #include #include namespace sdesktop::endpoints { void UI_Helper::preProcess(http::Method method, Context &context) { LOG_INFO("In UI helper - requesting %d", static_cast(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(service::name::service_desktop, std::make_unique(std::move(event))), service::name::appmgr); return {sent::delayed, std::nullopt}; } return {sent::no, std::nullopt}; } }; // namespace sdesktop::endpoints