summaryrefslogtreecommitdiffstats
path: root/src/core/frontend/applets
diff options
context:
space:
mode:
authorZach Hilman <zachhilman@gmail.com>2018-11-12 17:08:09 +0100
committerZach Hilman <zachhilman@gmail.com>2018-11-18 16:53:47 +0100
commit8b433beff34c382e50334bb59c4f71394845558c (patch)
treef52f432b2ee5f4ef3917c1c0e2fa052930d68f3a /src/core/frontend/applets
parentam: Allow applets to push multiple and different channels of data (diff)
downloadyuzu-8b433beff34c382e50334bb59c4f71394845558c.tar
yuzu-8b433beff34c382e50334bb59c4f71394845558c.tar.gz
yuzu-8b433beff34c382e50334bb59c4f71394845558c.tar.bz2
yuzu-8b433beff34c382e50334bb59c4f71394845558c.tar.lz
yuzu-8b433beff34c382e50334bb59c4f71394845558c.tar.xz
yuzu-8b433beff34c382e50334bb59c4f71394845558c.tar.zst
yuzu-8b433beff34c382e50334bb59c4f71394845558c.zip
Diffstat (limited to 'src/core/frontend/applets')
-rw-r--r--src/core/frontend/applets/software_keyboard.cpp7
-rw-r--r--src/core/frontend/applets/software_keyboard.h7
2 files changed, 9 insertions, 5 deletions
diff --git a/src/core/frontend/applets/software_keyboard.cpp b/src/core/frontend/applets/software_keyboard.cpp
index 2445a980d..4105101b3 100644
--- a/src/core/frontend/applets/software_keyboard.cpp
+++ b/src/core/frontend/applets/software_keyboard.cpp
@@ -9,12 +9,13 @@
namespace Core::Frontend {
SoftwareKeyboardApplet::~SoftwareKeyboardApplet() = default;
-std::optional<std::u16string> DefaultSoftwareKeyboardApplet::GetText(
+void DefaultSoftwareKeyboardApplet::RequestText(
+ std::function<void(std::optional<std::u16string>)> out,
SoftwareKeyboardParameters parameters) const {
if (parameters.initial_text.empty())
- return u"yuzu";
+ out(u"yuzu");
- return parameters.initial_text;
+ out(parameters.initial_text);
}
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 7387ee8d7..5420ea883 100644
--- a/src/core/frontend/applets/software_keyboard.h
+++ b/src/core/frontend/applets/software_keyboard.h
@@ -4,6 +4,7 @@
#pragma once
+#include <functional>
#include <optional>
#include <string>
#include "common/bit_field.h"
@@ -36,13 +37,15 @@ class SoftwareKeyboardApplet {
public:
virtual ~SoftwareKeyboardApplet();
- virtual std::optional<std::u16string> GetText(SoftwareKeyboardParameters parameters) const = 0;
+ virtual void RequestText(std::function<void(std::optional<std::u16string>)> out,
+ SoftwareKeyboardParameters parameters) const = 0;
virtual void SendTextCheckDialog(std::u16string error_message) const = 0;
};
class DefaultSoftwareKeyboardApplet final : public SoftwareKeyboardApplet {
public:
- std::optional<std::u16string> GetText(SoftwareKeyboardParameters parameters) const override;
+ void RequestText(std::function<void(std::optional<std::u16string>)> out,
+ SoftwareKeyboardParameters parameters) const override;
void SendTextCheckDialog(std::u16string error_message) const override;
};