summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/am/applets/applets.h
blob: 1f91392b47f68131286e5459c01dfd439d70547e (plain) (blame)
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
// Copyright 2018 yuzu emulator team
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.

#pragma once

#include <memory>
#include <vector>
#include "common/swap.h"

namespace Frontend {
class SoftwareKeyboardApplet;
}

namespace Service::AM {

class IStorage;

namespace Applets {

class Applet {
public:
    virtual void Initialize(std::vector<std::shared_ptr<IStorage>> storage);

    virtual IStorage Execute() = 0;

protected:
    struct CommonArguments {
        u32_le arguments_version;
        u32_le size;
        u32_le library_version;
        u32_le theme_color;
        u8 play_startup_sound;
        u64_le system_tick;
    };
    static_assert(sizeof(CommonArguments) == 0x20, "CommonArguments has incorrect size.");

    std::vector<std::shared_ptr<IStorage>> storage_stack;
    bool initialized = false;
};

void RegisterSoftwareKeyboard(std::shared_ptr<Frontend::SoftwareKeyboardApplet> applet);
std::shared_ptr<Frontend::SoftwareKeyboardApplet> GetSoftwareKeyboard();

} // namespace Applets
} // namespace Service::AM