summaryrefslogtreecommitdiff
path: root/src/core/frontend/applets
diff options
context:
space:
mode:
authorGravatar Morph2021-01-30 14:38:00 -0500
committerGravatar Morph2021-04-15 01:53:16 -0400
commit0f40c8c6340aa858cd2e2ffe2e6c54885e0a3649 (patch)
tree64577d64b355f354ab35e058b077f17be358f303 /src/core/frontend/applets
parentMerge pull request #6199 from lioncash/log-ns (diff)
downloadyuzu-0f40c8c6340aa858cd2e2ffe2e6c54885e0a3649.tar.gz
yuzu-0f40c8c6340aa858cd2e2ffe2e6c54885e0a3649.tar.xz
yuzu-0f40c8c6340aa858cd2e2ffe2e6c54885e0a3649.zip
applets: Remove the previous software keyboard applet implementation
Diffstat (limited to 'src/core/frontend/applets')
-rw-r--r--src/core/frontend/applets/software_keyboard.cpp20
-rw-r--r--src/core/frontend/applets/software_keyboard.h34
2 files changed, 1 insertions, 53 deletions
diff --git a/src/core/frontend/applets/software_keyboard.cpp b/src/core/frontend/applets/software_keyboard.cpp
index 856ed33da..73e7a89b9 100644
--- a/src/core/frontend/applets/software_keyboard.cpp
+++ b/src/core/frontend/applets/software_keyboard.cpp
@@ -2,28 +2,10 @@
2// Licensed under GPLv2 or any later version 2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5#include "common/logging/backend.h"
6#include "common/string_util.h"
7#include "core/frontend/applets/software_keyboard.h" 5#include "core/frontend/applets/software_keyboard.h"
8 6
9namespace Core::Frontend { 7namespace Core::Frontend {
10SoftwareKeyboardApplet::~SoftwareKeyboardApplet() = default;
11
12void DefaultSoftwareKeyboardApplet::RequestText(
13 std::function<void(std::optional<std::u16string>)> out,
14 SoftwareKeyboardParameters parameters) const {
15 if (parameters.initial_text.empty())
16 out(u"yuzu");
17 8
18 out(parameters.initial_text); 9SoftwareKeyboardApplet::~SoftwareKeyboardApplet() = default;
19}
20 10
21void DefaultSoftwareKeyboardApplet::SendTextCheckDialog(
22 std::u16string error_message, std::function<void()> finished_check) const {
23 LOG_WARNING(Service_AM,
24 "(STUBBED) called - Default fallback software keyboard does not support text "
25 "check! (error_message={})",
26 Common::UTF16ToUTF8(error_message));
27 finished_check();
28}
29} // namespace Core::Frontend 11} // namespace Core::Frontend
diff --git a/src/core/frontend/applets/software_keyboard.h b/src/core/frontend/applets/software_keyboard.h
index f9b202664..54528837e 100644
--- a/src/core/frontend/applets/software_keyboard.h
+++ b/src/core/frontend/applets/software_keyboard.h
@@ -4,51 +4,17 @@
4 4
5#pragma once 5#pragma once
6 6
7#include <functional>
8#include <optional>
9#include <string>
10#include "common/bit_field.h"
11#include "common/common_types.h" 7#include "common/common_types.h"
12 8
13namespace Core::Frontend { 9namespace Core::Frontend {
14struct SoftwareKeyboardParameters {
15 std::u16string submit_text;
16 std::u16string header_text;
17 std::u16string sub_text;
18 std::u16string guide_text;
19 std::u16string initial_text;
20 std::size_t max_length;
21 bool password;
22 bool cursor_at_beginning;
23
24 union {
25 u8 value;
26
27 BitField<1, 1, u8> disable_space;
28 BitField<2, 1, u8> disable_address;
29 BitField<3, 1, u8> disable_percent;
30 BitField<4, 1, u8> disable_slash;
31 BitField<6, 1, u8> disable_number;
32 BitField<7, 1, u8> disable_download_code;
33 };
34};
35 10
36class SoftwareKeyboardApplet { 11class SoftwareKeyboardApplet {
37public: 12public:
38 virtual ~SoftwareKeyboardApplet(); 13 virtual ~SoftwareKeyboardApplet();
39
40 virtual void RequestText(std::function<void(std::optional<std::u16string>)> out,
41 SoftwareKeyboardParameters parameters) const = 0;
42 virtual void SendTextCheckDialog(std::u16string error_message,
43 std::function<void()> finished_check) const = 0;
44}; 14};
45 15
46class DefaultSoftwareKeyboardApplet final : public SoftwareKeyboardApplet { 16class DefaultSoftwareKeyboardApplet final : public SoftwareKeyboardApplet {
47public: 17public:
48 void RequestText(std::function<void(std::optional<std::u16string>)> out,
49 SoftwareKeyboardParameters parameters) const override;
50 void SendTextCheckDialog(std::u16string error_message,
51 std::function<void()> finished_check) const override;
52}; 18};
53 19
54} // namespace Core::Frontend 20} // namespace Core::Frontend