diff options
| author | 2018-11-11 20:16:38 -0500 | |
|---|---|---|
| committer | 2018-11-18 10:53:47 -0500 | |
| commit | 7cfb29de23836aa1873bbb108e3d25a0e9dcfa6d (patch) | |
| tree | 6ed63f8c93a0d9b4e0cb6ac8d41e0a94aa149e99 /src/core/frontend/applets | |
| parent | am: Implement ILibraryAppletAccessor IsCompleted and GetResult (diff) | |
| download | yuzu-7cfb29de23836aa1873bbb108e3d25a0e9dcfa6d.tar.gz yuzu-7cfb29de23836aa1873bbb108e3d25a0e9dcfa6d.tar.xz yuzu-7cfb29de23836aa1873bbb108e3d25a0e9dcfa6d.zip | |
am: Allow applets to push multiple and different channels of data
Diffstat (limited to 'src/core/frontend/applets')
| -rw-r--r-- | src/core/frontend/applets/software_keyboard.cpp | 10 | ||||
| -rw-r--r-- | src/core/frontend/applets/software_keyboard.h | 5 |
2 files changed, 7 insertions, 8 deletions
diff --git a/src/core/frontend/applets/software_keyboard.cpp b/src/core/frontend/applets/software_keyboard.cpp index cf5e2ea31..2445a980d 100644 --- a/src/core/frontend/applets/software_keyboard.cpp +++ b/src/core/frontend/applets/software_keyboard.cpp | |||
| @@ -9,14 +9,12 @@ | |||
| 9 | namespace Core::Frontend { | 9 | namespace Core::Frontend { |
| 10 | SoftwareKeyboardApplet::~SoftwareKeyboardApplet() = default; | 10 | SoftwareKeyboardApplet::~SoftwareKeyboardApplet() = default; |
| 11 | 11 | ||
| 12 | bool DefaultSoftwareKeyboardApplet::GetText(SoftwareKeyboardParameters parameters, | 12 | std::optional<std::u16string> DefaultSoftwareKeyboardApplet::GetText( |
| 13 | std::u16string& text) const { | 13 | SoftwareKeyboardParameters parameters) const { |
| 14 | if (parameters.initial_text.empty()) | 14 | if (parameters.initial_text.empty()) |
| 15 | text = u"yuzu"; | 15 | return u"yuzu"; |
| 16 | else | ||
| 17 | text = parameters.initial_text; | ||
| 18 | 16 | ||
| 19 | return true; | 17 | return parameters.initial_text; |
| 20 | } | 18 | } |
| 21 | 19 | ||
| 22 | void DefaultSoftwareKeyboardApplet::SendTextCheckDialog(std::u16string error_message) const { | 20 | void DefaultSoftwareKeyboardApplet::SendTextCheckDialog(std::u16string error_message) const { |
diff --git a/src/core/frontend/applets/software_keyboard.h b/src/core/frontend/applets/software_keyboard.h index 0a82aac0d..7387ee8d7 100644 --- a/src/core/frontend/applets/software_keyboard.h +++ b/src/core/frontend/applets/software_keyboard.h | |||
| @@ -4,6 +4,7 @@ | |||
| 4 | 4 | ||
| 5 | #pragma once | 5 | #pragma once |
| 6 | 6 | ||
| 7 | #include <optional> | ||
| 7 | #include <string> | 8 | #include <string> |
| 8 | #include "common/bit_field.h" | 9 | #include "common/bit_field.h" |
| 9 | #include "common/common_types.h" | 10 | #include "common/common_types.h" |
| @@ -35,13 +36,13 @@ class SoftwareKeyboardApplet { | |||
| 35 | public: | 36 | public: |
| 36 | virtual ~SoftwareKeyboardApplet(); | 37 | virtual ~SoftwareKeyboardApplet(); |
| 37 | 38 | ||
| 38 | virtual bool GetText(SoftwareKeyboardParameters parameters, std::u16string& text) const = 0; | 39 | virtual std::optional<std::u16string> GetText(SoftwareKeyboardParameters parameters) const = 0; |
| 39 | virtual void SendTextCheckDialog(std::u16string error_message) const = 0; | 40 | virtual void SendTextCheckDialog(std::u16string error_message) const = 0; |
| 40 | }; | 41 | }; |
| 41 | 42 | ||
| 42 | class DefaultSoftwareKeyboardApplet final : public SoftwareKeyboardApplet { | 43 | class DefaultSoftwareKeyboardApplet final : public SoftwareKeyboardApplet { |
| 43 | public: | 44 | public: |
| 44 | bool GetText(SoftwareKeyboardParameters parameters, std::u16string& text) const override; | 45 | std::optional<std::u16string> GetText(SoftwareKeyboardParameters parameters) const override; |
| 45 | void SendTextCheckDialog(std::u16string error_message) const override; | 46 | void SendTextCheckDialog(std::u16string error_message) const override; |
| 46 | }; | 47 | }; |
| 47 | 48 | ||