~aleteoryx/muditaos

ref: 49bbaf51a012cce32d173394038eb981d9f0e278 muditaos/module-services/service-eink/messages/ImageMessage.cpp -rw-r--r-- 1.8 KiB
49bbaf51 — Adam Wulkiewicz [MOS-550] Improve refresh of the display 3 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// Copyright (c) 2017-2022, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "EinkMessage.hpp"
#include "ImageMessage.hpp"

namespace service::eink
{
    ImageMessage::ImageMessage(int contextId, ::gui::Context *context, ::gui::RefreshModes refreshMode)
        : contextId{contextId}, context{context}, refreshMode{refreshMode}
    {}

    auto ImageMessage::getContext() noexcept -> ::gui::Context *
    {
        return context;
    }

    auto ImageMessage::getRefreshMode() const noexcept -> ::gui::RefreshModes
    {
        return refreshMode;
    }

    auto ImageMessage::getContextId() const noexcept -> int
    {
        return contextId;
    }

    ImageDisplayedNotification::ImageDisplayedNotification(int contextId) : contextId{contextId}
    {}

    auto ImageDisplayedNotification::getContextId() const noexcept -> int
    {
        return contextId;
    }

    RefreshMessage::RefreshMessage(int contextId,
                                   hal::eink::EinkFrame refreshFrame,
                                   hal::eink::EinkRefreshMode refreshMode,
                                   const std::string &originalSender)
        : contextId(contextId), refreshFrame(refreshFrame), refreshMode(refreshMode), originalSender(originalSender)
    {}

    auto RefreshMessage::getContextId() const noexcept -> int
    {
        return contextId;
    }
    auto RefreshMessage::getRefreshFrame() noexcept -> hal::eink::EinkFrame
    {
        return refreshFrame;
    }
    auto RefreshMessage::getRefreshMode() const noexcept -> hal::eink::EinkRefreshMode
    {
        return refreshMode;
    }
    auto RefreshMessage::getOriginalSender() const noexcept -> const std::string &
    {
        return originalSender;
    }

} // namespace service::eink