summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/am
diff options
context:
space:
mode:
authorZach Hilman <zachhilman@gmail.com>2018-11-10 02:09:37 +0100
committerZach Hilman <zachhilman@gmail.com>2018-11-18 16:53:47 +0100
commit5b95de0c9cbe5185283e36426035798e05555c21 (patch)
tree1ae0300bc639ff1b6fe54e82a6dfe2761212c6d0 /src/core/hle/service/am
parentam: Unstub ILibraryAppletAccessor::Start (diff)
downloadyuzu-5b95de0c9cbe5185283e36426035798e05555c21.tar
yuzu-5b95de0c9cbe5185283e36426035798e05555c21.tar.gz
yuzu-5b95de0c9cbe5185283e36426035798e05555c21.tar.bz2
yuzu-5b95de0c9cbe5185283e36426035798e05555c21.tar.lz
yuzu-5b95de0c9cbe5185283e36426035798e05555c21.tar.xz
yuzu-5b95de0c9cbe5185283e36426035798e05555c21.tar.zst
yuzu-5b95de0c9cbe5185283e36426035798e05555c21.zip
Diffstat (limited to 'src/core/hle/service/am')
-rw-r--r--src/core/hle/service/am/applets/applets.cpp29
-rw-r--r--src/core/hle/service/am/applets/applets.h46
2 files changed, 75 insertions, 0 deletions
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 @@
+// Copyright 2018 yuzu emulator team
+// Licensed under GPLv2 or any later version
+// Refer to the license.txt file included.
+
+#include "core/frontend/applets/software_keyboard.h"
+#include "core/hle/service/am/applets/applets.h"
+
+namespace Service::AM::Applets {
+
+std::shared_ptr<Frontend::SoftwareKeyboardApplet> software_keyboard =
+ std::make_shared<Frontend::DefaultSoftwareKeyboardApplet>();
+
+void Applet::Initialize(std::vector<std::shared_ptr<IStorage>> storage) {
+ storage_stack = std::move(storage);
+ initialized = true;
+}
+
+void RegisterSoftwareKeyboard(std::shared_ptr<Frontend::SoftwareKeyboardApplet> applet) {
+ if (applet == nullptr)
+ return;
+
+ software_keyboard = std::move(applet);
+}
+
+std::shared_ptr<Frontend::SoftwareKeyboardApplet> GetSoftwareKeyboard() {
+ return software_keyboard;
+}
+
+} // 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 @@
+// 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