Files
MuditaOS/module-services/service-gui/WorkerGUI.hpp
Maciej Janicki bb59805a8e [EGD-4822] Add color test window to settings app
Add new window to allow convenient display and globally
change used color intensities  for design and testing purposes.
Changes were introduced to Renderer as well as GUI service
to allow global change of used color scheme.
When using list, screen is deep refreshed each
time the color is changed.
Known issues:
Item focus borders (top,bottom) with changed black intensity
may not render properly, however it doesn't obscure the
target functionality.
2021-02-04 13:34:04 +01:00

46 lines
1.3 KiB
C++

// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
#pragma once
#include "ServiceGUI.hpp"
#include <core/Context.hpp>
#include <core/DrawCommand.hpp>
#include <gui/core/Renderer.hpp>
#include <Service/Worker.hpp>
#include <cstdint>
namespace service::gui
{
class ServiceGUI;
class WorkerGUI : public sys::Worker
{
public:
enum class Signal
{
Render,
ChangeColorScheme,
};
static constexpr auto SignallingQueueName = "SignallingQueue";
static constexpr auto SignallingQueueCapacity = 1;
static constexpr auto SignalSize = sizeof(Signal);
explicit WorkerGUI(ServiceGUI *service);
void notify(Signal command);
auto handleMessage(std::uint32_t queueID) -> bool override;
private:
void handleCommand(Signal command);
void render(DrawCommandsQueue::CommandList &commands, ::gui::RefreshModes refreshMode);
void changeColorScheme(const std::unique_ptr<::gui::ColorScheme> &scheme);
void onRenderingFinished(int contextId, ::gui::RefreshModes refreshMode);
ServiceGUI *guiService;
::gui::Renderer renderer;
};
} // namespace service::gui