summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Zach Hilman2018-11-09 20:09:37 -0500
committerGravatar Zach Hilman2018-11-18 10:53:47 -0500
commit5b95de0c9cbe5185283e36426035798e05555c21 (patch)
tree1ae0300bc639ff1b6fe54e82a6dfe2761212c6d0
parentam: Unstub ILibraryAppletAccessor::Start (diff)
downloadyuzu-5b95de0c9cbe5185283e36426035798e05555c21.tar.gz
yuzu-5b95de0c9cbe5185283e36426035798e05555c21.tar.xz
yuzu-5b95de0c9cbe5185283e36426035798e05555c21.zip
am/applets: Add Applet superclass to describe a generic applet
Adds an Initialize and Execute methods which are used by the ILibraryAppletAccessor to start and control the applet.
Diffstat (limited to '')
-rw-r--r--src/core/CMakeLists.txt2
-rw-r--r--src/core/hle/service/am/applets/applets.cpp29
-rw-r--r--src/core/hle/service/am/applets/applets.h46
3 files changed, 77 insertions, 0 deletions
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index 64fdf38cd..698f21a39 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -150,6 +150,8 @@ add_library(core STATIC
150 hle/service/am/applet_ae.h 150 hle/service/am/applet_ae.h
151 hle/service/am/applet_oe.cpp 151 hle/service/am/applet_oe.cpp
152 hle/service/am/applet_oe.h 152 hle/service/am/applet_oe.h
153 hle/service/am/applets/applets.cpp
154 hle/service/am/applets/applets.h
153 hle/service/am/idle.cpp 155 hle/service/am/idle.cpp
154 hle/service/am/idle.h 156 hle/service/am/idle.h
155 hle/service/am/omm.cpp 157 hle/service/am/omm.cpp
diff --git a/src/core/hle/service/am/applets/applets.cpp b/src/core/hle/service/am/applets/applets.cpp
new file mode 100644
index 000000000..8cc4b0f1a
--- /dev/null
+++ b/src/core/hle/service/am/applets/applets.cpp
@@ -0,0 +1,29 @@
1// Copyright 2018 yuzu emulator team
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#include "core/frontend/applets/software_keyboard.h"
6#include "core/hle/service/am/applets/applets.h"
7
8namespace Service::AM::Applets {
9
10std::shared_ptr<Frontend::SoftwareKeyboardApplet> software_keyboard =
11 std::make_shared<Frontend::DefaultSoftwareKeyboardApplet>();
12
13void Applet::Initialize(std::vector<std::shared_ptr<IStorage>> storage) {
14 storage_stack = std::move(storage);
15 initialized = true;
16}
17
18void RegisterSoftwareKeyboard(std::shared_ptr<Frontend::SoftwareKeyboardApplet> applet) {
19 if (applet == nullptr)
20 return;
21
22 software_keyboard = std::move(applet);
23}
24
25std::shared_ptr<Frontend::SoftwareKeyboardApplet> GetSoftwareKeyboard() {
26 return software_keyboard;
27}
28
29} // namespace Service::AM::Applets
diff --git a/src/core/hle/service/am/applets/applets.h b/src/core/hle/service/am/applets/applets.h
new file mode 100644
index 000000000..1f91392b4
--- /dev/null
+++ b/src/core/hle/service/am/applets/applets.h
@@ -0,0 +1,46 @@
1// Copyright 2018 yuzu emulator team
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#pragma once
6
7#include <memory>
8#include <vector>
9#include "common/swap.h"
10
11namespace Frontend {
12class SoftwareKeyboardApplet;
13}
14
15namespace Service::AM {
16
17class IStorage;
18
19namespace Applets {
20
21class Applet {
22public:
23 virtual void Initialize(std::vector<std::shared_ptr<IStorage>> storage);
24
25 virtual IStorage Execute() = 0;
26
27protected:
28 struct CommonArguments {
29 u32_le arguments_version;
30 u32_le size;
31 u32_le library_version;
32 u32_le theme_color;
33 u8 play_startup_sound;
34 u64_le system_tick;
35 };
36 static_assert(sizeof(CommonArguments) == 0x20, "CommonArguments has incorrect size.");
37
38 std::vector<std::shared_ptr<IStorage>> storage_stack;
39 bool initialized = false;
40};
41
42void RegisterSoftwareKeyboard(std::shared_ptr<Frontend::SoftwareKeyboardApplet> applet);
43std::shared_ptr<Frontend::SoftwareKeyboardApplet> GetSoftwareKeyboard();
44
45} // namespace Applets
46} // namespace Service::AM