diff options
author | Narr the Reg <juangerman-13@hotmail.com> | 2024-01-31 17:25:28 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-31 17:25:28 +0100 |
commit | 7cc7d027f74b5bffc0b3f8f3a6c3110999c7cc4c (patch) | |
tree | 24b2ed412f2683c8460839778ea7761d052bc38f /src/core/hle/service/am/frontend/applet_software_keyboard.cpp | |
parent | Merge pull request #12858 from liamwhite/non-blocking (diff) | |
parent | am: push storage from error applet with non-zero size (diff) | |
download | yuzu-7cc7d027f74b5bffc0b3f8f3a6c3110999c7cc4c.tar yuzu-7cc7d027f74b5bffc0b3f8f3a6c3110999c7cc4c.tar.gz yuzu-7cc7d027f74b5bffc0b3f8f3a6c3110999c7cc4c.tar.bz2 yuzu-7cc7d027f74b5bffc0b3f8f3a6c3110999c7cc4c.tar.lz yuzu-7cc7d027f74b5bffc0b3f8f3a6c3110999c7cc4c.tar.xz yuzu-7cc7d027f74b5bffc0b3f8f3a6c3110999c7cc4c.tar.zst yuzu-7cc7d027f74b5bffc0b3f8f3a6c3110999c7cc4c.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/service/am/frontend/applet_software_keyboard.cpp (renamed from src/core/hle/service/am/applets/applet_software_keyboard.cpp) | 68 |
1 files changed, 33 insertions, 35 deletions
diff --git a/src/core/hle/service/am/applets/applet_software_keyboard.cpp b/src/core/hle/service/am/frontend/applet_software_keyboard.cpp index 4145bb84f..fbf75d379 100644 --- a/src/core/hle/service/am/applets/applet_software_keyboard.cpp +++ b/src/core/hle/service/am/frontend/applet_software_keyboard.cpp @@ -5,9 +5,10 @@ #include "core/core.h" #include "core/frontend/applets/software_keyboard.h" #include "core/hle/service/am/am.h" -#include "core/hle/service/am/applets/applet_software_keyboard.h" +#include "core/hle/service/am/frontend/applet_software_keyboard.h" +#include "core/hle/service/am/storage.h" -namespace Service::AM::Applets { +namespace Service::AM::Frontend { namespace { @@ -41,14 +42,15 @@ void SetReplyBase(std::vector<u8>& reply, SwkbdState state, SwkbdReplyType reply } // Anonymous namespace -SoftwareKeyboard::SoftwareKeyboard(Core::System& system_, LibraryAppletMode applet_mode_, +SoftwareKeyboard::SoftwareKeyboard(Core::System& system_, std::shared_ptr<Applet> applet_, + LibraryAppletMode applet_mode_, Core::Frontend::SoftwareKeyboardApplet& frontend_) - : Applet{system_, applet_mode_}, frontend{frontend_}, system{system_} {} + : FrontendApplet{system_, applet_, applet_mode_}, frontend{frontend_} {} SoftwareKeyboard::~SoftwareKeyboard() = default; void SoftwareKeyboard::Initialize() { - Applet::Initialize(); + FrontendApplet::Initialize(); LOG_INFO(Service_AM, "Initializing Software Keyboard Applet with LibraryAppletMode={}", applet_mode); @@ -76,10 +78,6 @@ void SoftwareKeyboard::Initialize() { } } -bool SoftwareKeyboard::TransactionComplete() const { - return complete; -} - Result SoftwareKeyboard::GetStatus() const { return status; } @@ -184,7 +182,7 @@ void SoftwareKeyboard::InitializeForeground() { is_background = false; - const auto swkbd_config_storage = broker.PopNormalDataToApplet(); + const auto swkbd_config_storage = PopInData(); ASSERT(swkbd_config_storage != nullptr); const auto& swkbd_config_data = swkbd_config_storage->GetData(); @@ -221,7 +219,7 @@ void SoftwareKeyboard::InitializeForeground() { break; } - const auto work_buffer_storage = broker.PopNormalDataToApplet(); + const auto work_buffer_storage = PopInData(); ASSERT(work_buffer_storage != nullptr); if (swkbd_config_common.initial_string_length == 0) { @@ -250,7 +248,7 @@ void SoftwareKeyboard::InitializeBackground(LibraryAppletMode library_applet_mod is_background = true; - const auto swkbd_inline_initialize_arg_storage = broker.PopNormalDataToApplet(); + const auto swkbd_inline_initialize_arg_storage = PopInData(); ASSERT(swkbd_inline_initialize_arg_storage != nullptr); const auto& swkbd_inline_initialize_arg = swkbd_inline_initialize_arg_storage->GetData(); @@ -267,7 +265,7 @@ void SoftwareKeyboard::InitializeBackground(LibraryAppletMode library_applet_mod } void SoftwareKeyboard::ProcessTextCheck() { - const auto text_check_storage = broker.PopInteractiveDataToApplet(); + const auto text_check_storage = PopInteractiveInData(); ASSERT(text_check_storage != nullptr); const auto& text_check_data = text_check_storage->GetData(); @@ -314,7 +312,7 @@ void SoftwareKeyboard::ProcessTextCheck() { } void SoftwareKeyboard::ProcessInlineKeyboardRequest() { - const auto request_data_storage = broker.PopInteractiveDataToApplet(); + const auto request_data_storage = PopInteractiveInData(); ASSERT(request_data_storage != nullptr); const auto& request_data = request_data_storage->GetData(); @@ -377,7 +375,7 @@ void SoftwareKeyboard::SubmitNormalOutputAndExit(SwkbdResult result, submitted_text.size() * sizeof(char16_t)); } - broker.PushNormalDataFromApplet(std::make_shared<IStorage>(system, std::move(out_data))); + PushOutData(std::make_shared<IStorage>(system, std::move(out_data))); ExitKeyboard(); } @@ -410,7 +408,7 @@ void SoftwareKeyboard::SubmitForTextCheck(std::u16string submitted_text) { current_text.size() * sizeof(char16_t)); } - broker.PushInteractiveDataFromApplet(std::make_shared<IStorage>(system, std::move(out_data))); + PushInteractiveOutData(std::make_shared<IStorage>(system, std::move(out_data))); } void SoftwareKeyboard::SendReply(SwkbdReplyType reply_type) { @@ -767,7 +765,7 @@ void SoftwareKeyboard::ExitKeyboard() { frontend.ExitKeyboard(); - broker.SignalStateChanged(); + Exit(); } Result SoftwareKeyboard::RequestExit() { @@ -967,7 +965,7 @@ void SoftwareKeyboard::ReplyFinishedInitialize() { SetReplyBase(reply, swkbd_state, SwkbdReplyType::FinishedInitialize); - broker.PushInteractiveDataFromApplet(std::make_shared<IStorage>(system, std::move(reply))); + PushInteractiveOutData(std::make_shared<IStorage>(system, std::move(reply))); } void SoftwareKeyboard::ReplyDefault() { @@ -977,7 +975,7 @@ void SoftwareKeyboard::ReplyDefault() { SetReplyBase(reply, swkbd_state, SwkbdReplyType::Default); - broker.PushInteractiveDataFromApplet(std::make_shared<IStorage>(system, std::move(reply))); + PushInteractiveOutData(std::make_shared<IStorage>(system, std::move(reply))); } void SoftwareKeyboard::ReplyChangedString() { @@ -999,7 +997,7 @@ void SoftwareKeyboard::ReplyChangedString() { std::memcpy(reply.data() + REPLY_BASE_SIZE + REPLY_UTF16_SIZE, &changed_string_arg, sizeof(SwkbdChangedStringArg)); - broker.PushInteractiveDataFromApplet(std::make_shared<IStorage>(system, std::move(reply))); + PushInteractiveOutData(std::make_shared<IStorage>(system, std::move(reply))); } void SoftwareKeyboard::ReplyMovedCursor() { @@ -1019,7 +1017,7 @@ void SoftwareKeyboard::ReplyMovedCursor() { std::memcpy(reply.data() + REPLY_BASE_SIZE + REPLY_UTF16_SIZE, &moved_cursor_arg, sizeof(SwkbdMovedCursorArg)); - broker.PushInteractiveDataFromApplet(std::make_shared<IStorage>(system, std::move(reply))); + PushInteractiveOutData(std::make_shared<IStorage>(system, std::move(reply))); } void SoftwareKeyboard::ReplyMovedTab() { @@ -1039,7 +1037,7 @@ void SoftwareKeyboard::ReplyMovedTab() { std::memcpy(reply.data() + REPLY_BASE_SIZE + REPLY_UTF16_SIZE, &moved_tab_arg, sizeof(SwkbdMovedTabArg)); - broker.PushInteractiveDataFromApplet(std::make_shared<IStorage>(system, std::move(reply))); + PushInteractiveOutData(std::make_shared<IStorage>(system, std::move(reply))); } void SoftwareKeyboard::ReplyDecidedEnter() { @@ -1058,7 +1056,7 @@ void SoftwareKeyboard::ReplyDecidedEnter() { std::memcpy(reply.data() + REPLY_BASE_SIZE + REPLY_UTF16_SIZE, &decided_enter_arg, sizeof(SwkbdDecidedEnterArg)); - broker.PushInteractiveDataFromApplet(std::make_shared<IStorage>(system, std::move(reply))); + PushInteractiveOutData(std::make_shared<IStorage>(system, std::move(reply))); HideInlineKeyboard(); } @@ -1070,7 +1068,7 @@ void SoftwareKeyboard::ReplyDecidedCancel() { SetReplyBase(reply, swkbd_state, SwkbdReplyType::DecidedCancel); - broker.PushInteractiveDataFromApplet(std::make_shared<IStorage>(system, std::move(reply))); + PushInteractiveOutData(std::make_shared<IStorage>(system, std::move(reply))); HideInlineKeyboard(); } @@ -1095,7 +1093,7 @@ void SoftwareKeyboard::ReplyChangedStringUtf8() { std::memcpy(reply.data() + REPLY_BASE_SIZE + REPLY_UTF8_SIZE, &changed_string_arg, sizeof(SwkbdChangedStringArg)); - broker.PushInteractiveDataFromApplet(std::make_shared<IStorage>(system, std::move(reply))); + PushInteractiveOutData(std::make_shared<IStorage>(system, std::move(reply))); } void SoftwareKeyboard::ReplyMovedCursorUtf8() { @@ -1116,7 +1114,7 @@ void SoftwareKeyboard::ReplyMovedCursorUtf8() { std::memcpy(reply.data() + REPLY_BASE_SIZE + REPLY_UTF8_SIZE, &moved_cursor_arg, sizeof(SwkbdMovedCursorArg)); - broker.PushInteractiveDataFromApplet(std::make_shared<IStorage>(system, std::move(reply))); + PushInteractiveOutData(std::make_shared<IStorage>(system, std::move(reply))); } void SoftwareKeyboard::ReplyDecidedEnterUtf8() { @@ -1136,7 +1134,7 @@ void SoftwareKeyboard::ReplyDecidedEnterUtf8() { std::memcpy(reply.data() + REPLY_BASE_SIZE + REPLY_UTF8_SIZE, &decided_enter_arg, sizeof(SwkbdDecidedEnterArg)); - broker.PushInteractiveDataFromApplet(std::make_shared<IStorage>(system, std::move(reply))); + PushInteractiveOutData(std::make_shared<IStorage>(system, std::move(reply))); HideInlineKeyboard(); } @@ -1148,7 +1146,7 @@ void SoftwareKeyboard::ReplyUnsetCustomizeDic() { SetReplyBase(reply, swkbd_state, SwkbdReplyType::UnsetCustomizeDic); - broker.PushInteractiveDataFromApplet(std::make_shared<IStorage>(system, std::move(reply))); + PushInteractiveOutData(std::make_shared<IStorage>(system, std::move(reply))); } void SoftwareKeyboard::ReplyReleasedUserWordInfo() { @@ -1158,7 +1156,7 @@ void SoftwareKeyboard::ReplyReleasedUserWordInfo() { SetReplyBase(reply, swkbd_state, SwkbdReplyType::ReleasedUserWordInfo); - broker.PushInteractiveDataFromApplet(std::make_shared<IStorage>(system, std::move(reply))); + PushInteractiveOutData(std::make_shared<IStorage>(system, std::move(reply))); } void SoftwareKeyboard::ReplyUnsetCustomizedDictionaries() { @@ -1168,7 +1166,7 @@ void SoftwareKeyboard::ReplyUnsetCustomizedDictionaries() { SetReplyBase(reply, swkbd_state, SwkbdReplyType::UnsetCustomizedDictionaries); - broker.PushInteractiveDataFromApplet(std::make_shared<IStorage>(system, std::move(reply))); + PushInteractiveOutData(std::make_shared<IStorage>(system, std::move(reply))); } void SoftwareKeyboard::ReplyChangedStringV2() { @@ -1194,7 +1192,7 @@ void SoftwareKeyboard::ReplyChangedStringV2() { std::memcpy(reply.data() + REPLY_BASE_SIZE + REPLY_UTF16_SIZE + sizeof(SwkbdChangedStringArg), &flag, 1); - broker.PushInteractiveDataFromApplet(std::make_shared<IStorage>(system, std::move(reply))); + PushInteractiveOutData(std::make_shared<IStorage>(system, std::move(reply))); } void SoftwareKeyboard::ReplyMovedCursorV2() { @@ -1218,7 +1216,7 @@ void SoftwareKeyboard::ReplyMovedCursorV2() { std::memcpy(reply.data() + REPLY_BASE_SIZE + REPLY_UTF16_SIZE + sizeof(SwkbdMovedCursorArg), &flag, 1); - broker.PushInteractiveDataFromApplet(std::make_shared<IStorage>(system, std::move(reply))); + PushInteractiveOutData(std::make_shared<IStorage>(system, std::move(reply))); } void SoftwareKeyboard::ReplyChangedStringUtf8V2() { @@ -1245,7 +1243,7 @@ void SoftwareKeyboard::ReplyChangedStringUtf8V2() { std::memcpy(reply.data() + REPLY_BASE_SIZE + REPLY_UTF8_SIZE + sizeof(SwkbdChangedStringArg), &flag, 1); - broker.PushInteractiveDataFromApplet(std::make_shared<IStorage>(system, std::move(reply))); + PushInteractiveOutData(std::make_shared<IStorage>(system, std::move(reply))); } void SoftwareKeyboard::ReplyMovedCursorUtf8V2() { @@ -1270,7 +1268,7 @@ void SoftwareKeyboard::ReplyMovedCursorUtf8V2() { std::memcpy(reply.data() + REPLY_BASE_SIZE + REPLY_UTF8_SIZE + sizeof(SwkbdMovedCursorArg), &flag, 1); - broker.PushInteractiveDataFromApplet(std::make_shared<IStorage>(system, std::move(reply))); + PushInteractiveOutData(std::make_shared<IStorage>(system, std::move(reply))); } -} // namespace Service::AM::Applets +} // namespace Service::AM::Frontend |